Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help "open popup after close window " ??

Status
Not open for further replies.

iketutg

Programmer
Jul 21, 2003
3
ID
this is source if i close window open popup and i click link test open popup too , how the open popup just i close window, not for click link test
----------------------------------------------
<html>
<head>
<title></title>
<script language=&quot;JavaScript&quot;>
<!--
function leave()
{
if (exit)
open(&quot;popup/popupexit.htm&quot;,
'xXexit','location=0,menubar=0,toolbar=0,person albar=0,status=0,scrollbar=0,width=531,height=500,top=0,left=0');
}
// -->
</script>
</head>
<body leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; onunload=&quot;leave()&quot;>
<br>
<a href=test.html>test</a>
</body>
</html>
------------------------------------------
 
You can't. The onunload event will fire regardless of how you go about unloading the page.

My advice... Don't annoy people with popups, especially popups that they didn't ask for.
 
hi there


looking at your code if you want to test the popup that you are using to popup when the window closes. Like all java look at the name of the function in the java as this is your launch command.

so to get your popup to jump without the window closing simply add the onlcick=&quot;leave()&quot; to the tags round test like so. this will make it launch the java when it is clicked upon.

like so:
----------------------------------------------
<html>
<head>
<title></title>
<script language=&quot;JavaScript&quot;>
<!--
function leave()
{
if (exit)
open(&quot;popup/popupexit.htm&quot;,
'xXexit','location=0,menubar=0,toolbar=0,person albar=0,status=0,scrollbar=0,width=531,height=500,top=0,left=0');
}
// -->
</script>
</head>
<body leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; onunload=&quot;leave()&quot;>
<br>
<a href=test.html onclick=&quot;leave()&quot;>test</a>
</body>
</html>
------------------------------------------

now if you run this code when you click on test the popup should appear and the page stay open.

even though the other chap is right popups can be annoying if used incorrectly. if you stick this code on all your pages because you do not know where they will be leaving the site then every page will through up a popup.

if you are going to insist on using popups i advise using a script so that once a popup has been displayed it drops a cookie saying it has been shown and then does not appear again that day.

this way each popup is only seen once each visit to the site and will not drive vistors away from your site due to getting hacked off having to close extra popups every five minutes.

here is an example of a easy to configure script of this nature.

as this site is run in frames to see what other goodies this site has to offer simply put to access the wide varity of useful stuff this site has to offer

cheers

DEAN
 
thank's every body ,
but i want if i click test , not open popup
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top