Search the web
Sign In
New User? Sign Up
ydn-javascript · Yahoo! User Interface Library Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Exit Survey - problems with unload   Message List  
Reply | Forward Message #31104 of 52127 |
Re: [ydn-javascript] Exit Survey - problems with unload

Matt,

You may want to try:

var targ= YAHOO.util.Event.getTarget(e);
if(targ.href && ! isAllowedDomain(targ.href)){blah}


Regards,
Eric

YAHOO.util.Event.element(e);
if(targ.href && ! isAllowedDomain(targ.href)){blah}
On May 15, 2008, at 11:27 PM, tazatek wrote:

Hi,

Disclaimer - I'm new to YUI, so go easy on me :)

I'm attempting to create a simple exit survey that will only trigger
when a user goes offsite to a different domain. No other event/action
should generate this popup.

I found some code on Matt Sniders site that partially implements it,
but too many details left out to create a fully functioning piece.

I've been able to get parts of it working, but I get an error with a
line like this: 

YAHOO.util.Event.element(e);
if(targ.href && ! isAllowedDomain(targ.href)){blah}

I'm needing to check the name of the domain so that I know if I should
popup the message, but this obviously isn't working.

Any thoughts on this?

Is there a better way to create on unload popup? 

Any help with pointers on how to use the YUI to create an exit survey
would be much appreciated.

Thanks, 
Matt
www.pairs-list.com

---------------- CODE SNIPPET BELOW --------------

YAHOO.util.Event.addListener(window,window.beforeunload?'beforeunload':'unload,isShowable);

var showPopup = function() { 


window.open('/survey.php','misc_win','status=off,toolbar=off,location=off,menubar=off,directories=off,resizable=off,scrollbars=off,height=500,
width=500'); 

}; 

function isShowable(e){
if(!isAllowedDomain(YAHOO.util.Event.element(e).href){ 



var y = YAHOO.util.Event.getPageY(e); 



if(y<=0){ 


var x = YAHOO.util.Event.getPageX(e); 




if(x>20) { 


showPopup(); 


} else if(x <=0 ){ 


showPopup(); 


} 

} 

} 

};




Sat May 17, 2008 12:59 am

ericmiraglia
Online Now Online Now
Send Email Send Email

Forward
Message #31104 of 52127 |
Expand Messages Author Sort by Date

Hi, Disclaimer - I'm new to YUI, so go easy on me :) I'm attempting to create a simple exit survey that will only trigger when a user goes offsite to a...
tazatek
Offline Send Email
May 16, 2008
6:27 am

Matt, You may want to try: var targ= YAHOO.util.Event.getTarget(e); if(targ.href && ! isAllowedDomain(targ.href)){blah} Regards, Eric...
Eric Miraglia
ericmiraglia
Online Now Send Email
May 17, 2008
1:00 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help