HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 17th, 2000, 02:06 PM
SoccerFan SoccerFan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 11 SoccerFan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0

Hi everyone. I'm having trouble with this effect and wanted to know if anyone can lend a hand. I'm sure it's easy as pie, but I can't find the error(s).

I'm setting up an "exit questionaire". Whenever a client leaves the site (by closing the window, buy manually writing in a new URL or whatever) I want a new window to pop up to ask them about their experience on the site (I think this is a terrible idea but my client wants it....)

It's easy to get one to do that whenever you leave the site, but I DON"T want it to happen when someone navigates forward through the site links.

This was my solution (which doesn't work):

(in the head section)

<script language="javascript"><!--
function goExit(stay) {

if (stay == "no")

{

nextWin=window.open('http://www.weight-loss-diet-4u.com/form.html','lastWin','status=no,resizable=yes,scrollbars=yes,location=no,left=0,top=0,width=700,heig ht=500');

}

}


//-->
</script>


(in the body tag)

<BODY onUnload="goExit('no')" BGCOLOR="#FFFFFF" VLINK="0000FF">

(in the body - nav link)

<A HREF="http://www.next.com" onClick="goExit('yes')"><B>CLICK HERE</B></A>

Why won't this work?

Any ideas?

What happens it the darn thing ALWAYS pops it up. Any other scripts that do this would be welcome as well.

Thanks!!

Reply With Quote
  #2  
Old October 17th, 2000, 04:35 PM
Anarchos Anarchos is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 28 Anarchos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The reason is that your logic is not correct. The onClick will fire whenever you click the link, with stay="yes", and afterwards the onUnload will fire, with stay="no". What you need to do is have all of your internal links have a function in the onClick that sets some global boolean, then in your goExit, test that boolean to see if it's an internal or external link.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > popin up a new window - sometimes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT