Click to See Complete Forum and Search --> : popup window when leaving page


bcruzan
04-22-2003, 07:51 PM
I'm designing a web site and my client wants a pop-up window (containing a survey) to appear under two conditions:

1: When user closes the window

and more importantly:

2: When following certain links. In this case, the main window should proceed to the page the link directs to, and a popup should appear.

I don't know that it matters, but the site is http://rutgerstomato.org if you need to take a look. The popups are going to appear when a user is on any page in the Grower section of the site and they follow a link that leaves the grower section.

Thanks so much for your help. I've looked over so many scripts, and none can accomplish what I need.

DrDaMour
04-22-2003, 07:59 PM
<body onunload="window.open('url','target','attributes')>

bcruzan
04-22-2003, 08:42 PM
That's helpful, but the popup should not appear for *every* link on the page, only those links that go to a different section of the website or an outside link.

for example, within the "Grower" section of the web site, a user clicks a link to ...site/GROWER/page2.html there should be no popup. but when they follow a link to site/CONSUMER/page1.html there should be a popup.

I assume I will need to apply a script to every link that should cause a popup. Any ideas?

thanks again.

DrDaMour
04-22-2003, 09:14 PM
that was just a stepping stone..i was expecting you to take it and work with it, but let me guide you more

you need a sentinel to tell if there shoudl be a pop up or not


body onunload="if(popup == 1) {window.open(...)};


then in your links

onclick="popup=0" to turn off the popup.