MasterDiz.com
The WebMasters Portal           Home
A window that pops Up when the you leave the page Free Webmasters Resources

A Tutorial on
How to make a popup window when you leave the page.

Sample HTML Document This is the SCRIPT Copy and paste Instructions
<html>
<head>
<title>
</title>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function justpop() {

var popunder= "
http://www.masterdiz.com/";
var width =
788;
var height =
480;
var left = screen.width - width +
60;
var p = 'scrollbars=
yes, resizable=yes,toolbar=yes,' + 'menubar=no,status=no,location=no, left=' + left + ',top=0,height=' + height + ',width=' + width;
win2=window.open(popunder,"",p);
win2.blur();
win2.width =
788 ;
win2.height =
480 ;
win2.left = left ;
}

// -->
</script>

</head>
<body leftmargin='0' topmargin='0' onUnload="justpop()">

</body>
</html>

First Part

This goes between <head>and</head>
Put the mouse cursor in the box, right mouse button click, select all, copy and past it in you html document.


 


 

Second Part

This goes in the <body here> Tag
Put the mouse cursor in the box, right mouse button click, select all, copy and past it in you html document.


 

Thanks to your donation all the resources in this website are free for personal and commercial use.


Go to the forum or
directly to support page

This Script has 2 parts;
The first part goes between
<head>
and </head> Tags.

Put the URL of the web page or web site that you want to Pop uP where it says THE URL GOES HERE; in the Sample HTML Document, the URL is: http://www.masterdiz.com With Blue letters (see sample html document)
You can change the variables in the script; showing in
green in the sample html document

The second part goes inside the
<body
here>
 
It is very easy to make a mistake in the second part;

The wrong way is:

<body body leftmargin='0' topmargin='0' onUnload="justpop()">
The Right way to do it is:
<body leftmargin='0' topmargin='0' onUnload="justpop()">
See the Sample HTML document.

If you already have something else in your body tag like bgcolor="#??????" text="#??????", Just add the rest like this:

<body bgcolor="#620000" text="#FF8000" topmargin="0"
leftmargin="0" onunload="justpop()"
>

Disclaimer


Copyright (C) 2012 masterdiz.com (I don't claim the copyright for the script but for the design and presentation)