Today, I checked my website background logon Detection Using JQuery + AJAX + PHP. The compatibility in other browsers is good. As a result, the JS built-in function setTimeout in FireFox is not executed, this article provides detailed solutions. Today, I checked my website background logon Detection Using JQuery + AJAX + PHP. After I found that my login was successful, I executed the page Jump function section JavaScript (JS) code effects can be executed well in IE and Google Chrome, And the compatibility is good. As a result, the JS built-in function setTimeout in FireFox is not executed. It is invalid and no error is reported! Open FireBUG and expect it to detect JS errors. The result is useless... the compatibility of Javascript (JS) script code in various browsers is a headache. After some debugging and searching, finally, the error of running and executing the setTimeout JS Code in Firefox is solved. Currently, this setTimeout is compatible with IE6, 9, Google Chrome, FireFox, Apple Safari, and Opera.
SetTimeout is a very good function, which is often used by front-end engineers on the website pages in a few seconds. SetTimeout: The JS built-in function is also easy to use. The following describes the setTimeout () function and its usage and examples and sample code:
SetTimeout () is used to specify how many milliseconds a JS function or expression code will be executed
SetTimeout usage, syntax, and parameter: setTimeout (code, millisec)
SetTimeout parameter description:
Code is a required parameter. The JavaScript code string to be executed after the function to be called.
Millisec is a required parameter. The number of milliseconds to wait before executing the code. The conversion between milliseconds and seconds is: 1000 milliseconds = 1 second
SetTimeout instance Code (the page jumps to the specified URL in 1 second ):
The Code is as follows: