First, JS delay loading
The code is as follows:
Copy Code code as follows:
<script language= "JavaScript" src= "id=" my "></script>
<script language= "JavaScript" >
settimeout ("document.getElementById" (' my '). src= ' include/... File ... php '; ", 3000);/delay 3 seconds
</script>
Second, JS finally loaded
Insert the following code where you want to insert JS:
<span id=l4ever>loading...</span>
Of course, that loading ... You can switch to 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>
Your JS code is here!</span>.
<script>L4EVER.innerHTML=AD_L4EVER.innerHTML; Ad_l4ever.innerhtml= "";</script>
Third, JS finally loaded
Want to show the location of the ad
<div id= "GUANGG1" ></div>
The content of the advertisement you want to display
Copy Code code as follows:
<div id= "Ggad1" style= "Display:none" >
<script language= "javascript" src= "/include/.......js" ></script>
</div>
Determine if there is an ad location to display
Copy Code code as follows:
<script language= "JavaScript" >
function Chkdiv (divid) {
var Chkid=document.getelementbyid (divID);
if (Chkid!= null)
{return true;}
Else
{return false;}
The last thing is to show the ads.
if (Chkdiv (' Guangg1 ')) {
document.getElementById (' Guangg1 '). Innerhtml= document.getElementById (' Ggad1 '). InnerHTML;
document.getElementById (' Ggad1 '). innerhtml= "";
}
</script>
SetTimeout usage
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.