netshop01
03-09-2003, 02:28 AM
Greetings,
This cookie based java-script pops up when a visitor arrives at the site (once per browser session). I would like the pop up to occur when the visitor LEAVES the site.
Can anybody provide an answer?
<script>
//Popup Window Script
//By JavaScript Kit (http://javascriptkit.com)
//JavaScript tutorials and over 400+ free scripts
function openpopup(){
var popurl="http://www.1st-in-net-shopping.com/_pop/work.html"
winpops=window.open(popurl,"","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 loadornot(){
if (get_cookie('poppedup')==''){
openpopup()
document.cookie="poppedup=yes"
}
}
loadornot()
</script>
This cookie based java-script pops up when a visitor arrives at the site (once per browser session). I would like the pop up to occur when the visitor LEAVES the site.
Can anybody provide an answer?
<script>
//Popup Window Script
//By JavaScript Kit (http://javascriptkit.com)
//JavaScript tutorials and over 400+ free scripts
function openpopup(){
var popurl="http://www.1st-in-net-shopping.com/_pop/work.html"
winpops=window.open(popurl,"","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 loadornot(){
if (get_cookie('poppedup')==''){
openpopup()
document.cookie="poppedup=yes"
}
}
loadornot()
</script>