Too much recursion 

Higher Order Javascript

 



   Subscribe in NewsGator Online    Subscribe in Rojo    Add to Google      Add to My AOL   Subscribe in FeedLounge   Add to netvibes  

Brendan Eich's Roadmap  Standard ECMA-262  www.schillmania.com  www.quirksmode.org 
www.snook.ca  www.davidflanagan.com  www.kryogenix.org  www.thomasfrank.se 
www.dustindiaz.com  Yahoo! UI Library  www.crockford.com  www.brainjacked.com 
chadlindstrom.ca  www.browserland.org     
       

Sunday, July 23, 2006

 

Confirm User Exit


Here is some code that alerts users that leaving the page might be a bad idea. It counts the number of attempts to leave the page and stops displaying the message after n attempts.
function confirmExit(){
if(!this.times) {this.times=0}
times++; if(times==2){window.onbeforeunload=''}
return 'All your sensitive information (email,posts,Google searches) '+
'is gathered by smart routers and warehoused in your namespace';
}
window.onbeforeunload= confirmExit;

Comments: Post a Comment

Links to this post:

Create a Link



<< Home

Archives

June 2006   July 2006   August 2006   September 2006  

This page is powered by Blogger. Isn't yours?