First JS delay loading
Copy Code code as follows:
<script language= "JavaScript" src= "id=" my "></script>
<script>
SetTimeout ("document.getElementById (' my '). src= ' include/common.php ';", 3000);/delay 3 seconds
</script>
In general, the use of settimeout to achieve
Second JS finally loaded
Insert the following code where you want to insert JS:
Copy Code code as follows:
<span id=l4ever>loading...</span>
Of course, that loading ... You can change your favorite small picture. It looks like an Ajax effect.
Then insert at the bottom of the page:
Copy Code code as follows:
<span class=spanclass id=ad_l4ever><script src= "1.js" ></script></SPAN>
JS Code
Copy Code code as follows:
<script>L4EVER.innerHTML=AD_L4EVER.innerHTML; Ad_l4ever.innerhtml= "";</script>
The standard syntax for settimeout is: settimeout (expression, time (milliseconds)) two parameters.
Here you'll note that the first parameter is called when a function is invoked, assuming that it is a functional.
1. Function No parameters:
function Alertv () {alert ("000");}
Delay one second when the first argument is not quoted ("" or "):
SetTimeout (alertv,1000);
Delay one second when the first argument is quoted again:
SetTimeout ("Alertv ()", 1000);
2. The function has the parameter:
function Alertv (event) {alert ("keycode=" +event.keycode);}
This should be set to:
settimeout (function () {ALERTV (event);},1000); Otherwise, you will be prompted for undefined parameters.
settimeout (function () {
$ ("#id"). HTML (DATASTR);
}, 1000);
jquery is implemented through delay, such as
$ ("#id"). Delay (1000). html (DATASTR);
SetTimeout (' yourfunction () ', 5000); Execute YourFunction () after 5 seconds, only once
SetInterval (' yourfunction () ', 5000); Perform a u every 5 seconds
If you call SetTimeout (' yourfunction () ', 5000) again in YourFunction (), you can complete a similar
The function of SetInterval (' yourfunction () ', 5000)
If there is a good way to do it, thank you for sharing.