Send timeout codes to javascript