This is the JS Code based on the cookie. It is collected from the Internet and is not tested in multiple browsers. The webpage window in IE is only displayed once.
Usage:
1. Add the following code to the head section of the webpage.
<SCRIPT language = "JavaScript">
Function openpopup (){
Window. open ('HTTP: // www.bkjia.com /')
}
Function get_cookie (Name ){
Var search = Name + "="
Var returnvalue = "";
If (document. cookie. length> 0 ){
Offset = document. cookie. indexOf (search)
If (offset! =-1 ){
Offset + = search. length
End = document. cookie. indexOf (";", offset );
If (end =-1)
End = document. cookie. length;
Returnvalue = unescape (document. cookie. substring (offset, end ))
}
}
Return returnvalue;
}
Function loadpopup (){
If (get_cookie ('popped') = ''){
Openpopup ()
Document. cookie = "popped = yes"
}
}
</SCRIPT>
2. Put the red code in the following code in the body, as follows.
<BodyOnunload = "loadpopup ()">
Demo:
<SCRIPT language = "JavaScript"> function openpopup () {window. open ('HTTP: // www.bkjia.com/')} function get_cookie (Name) {var search = Name + "=" var returnvalue = ""; if (document. cookie. length> 0) {offset = document. cookie. indexOf (search) if (offset! =-1) {offset + = search. lengthend = document. cookie. indexOf (";", offset); if (end =-1) end = document. cookie. length; returnvalue = unescape (document. cookie. substring (offset, end)} return returnvalue;} function loadpopup () {if (get_cookie ('popped') = '') {openpopup () document. cookie = "popped = yes" }}</SCRIPT> <body onunload = "loadpopup ()"> <br/> <center> If the effect cannot be displayed, press Ctrl + F5 to refresh the page. For more webpage code: <a href = 'HTTP: // www.bkjia.com/'target = '_ blank'> http://www.bkjia.com/</a> </center>
Tip: the code can be modified before running!