Cookie|javascript a pop-up window (JavaScript) with cookies
Script Description:
The first step: Add the following code to the <script language= "JavaScript" >
<!--
function Openpopup () {
window.open ("welcome.htm", "" "," width=300,height=300 ")
}
function Get_cookie (Name) {
var search = Name + "="
var returnvalue = "";
if (Document.cookie.length > 0) {
offset = document.cookie.indexOf (search)
if (offset!=-1) {//if cookie exists
Offset + = Search.length
Set index of beginning of value
End = Document.cookie.indexOf (";", offset);
Set index of end of cookie value
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>
Step Two: Change the contents of <body> to:
<body bgcolor= "#fef4d9" onunload= "Loadpopup ()" >