my popup script works only when the page is 100% loaded, help me fix that

The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

my popup script works only when the page is 100% loaded, help me fix that

I'm using java script to pop-up a little page after closing the main one, but i have a problem
the pop-up page, actually pops up only when the main page is fully loaded!
I need it to be popped up even when the page isn't 100% loaded
here is the script which i'm using
"
<script>

I use exactly this script cause it allows me to exclude the loading of the popup when link is clicked with this
onClick="exit=false"

so, in short
i need script who pops up a page on close, it must pops up a page even when the main page is not 100% loaded and allows the links to be excluded, cause i want the page to popup only on closing of the main page, and not when surfer follows a link

Well...that little trick with the onclick handler won't stop the function from being called if the user hits the 'back' button, or uses an OS menu, or navigates by any other means. Detecting a close, rather than just a document unloading, is difficult to do accurately. Anyway, you should get an unload event even if the page isn't fully loaded. Did you put the code up as 'high' as possible?

Well...that little trick with the onclick handler won't stop the function from being called if the user hits the 'back' button, or uses an OS menu, or navigates by any other means. Detecting a close, rather than just a document unloading, is difficult to do accurately. Anyway, you should get an unload event even if the page isn't fully loaded. Did you put the code up as 'high' as possible?