Code As follows:
Copy code The Code is as follows: <script language = "JavaScript">
VaR time = 10; // set the time of each pop-up in seconds. The current time is one day.
Function set (){
VaR then = new date ();
Then. settime (then. gettime () + time * 1000 );
Document. Cookie = "netbei = 1; expires =" + then. togmtstring ();
}
VaR cookiestring = new string (document. Cookie );
VaR cookieheader = "netbei = ";
VaR beginposition = cookiestring. indexof (cookieheader );
If (beginposition <0 ){
Document. writeln ("<SCRIPT src =" http://baidu.com/popup.htm "Language =" JavaScript "> </SCRIPT>"); // set the content of the pop-up window
Set ();
}
</SCRIPT>
Now we set it to 10 seconds, which is mainly for testing. After the test is successful, you can make changes as needed,
for example,
var time = 300;
one hour
var time = 3600;
modify the pop-up address, here I set the advertisement code. Of course, you can also change it to a pop-up page, and change row 13th to
window. open ("http://www.jb51.net/", "", "width = 800, Height = 500");
window. open ("http://www.baidu.com/", "", "width = 800, Height = 500");
How, master it?