Guruza search results for dhtml http://guruza.com/searches/show/18 Questions recently submitted to Guruza that match the query: dhtml Thu, 20 Nov 2008 13:16:57 -0800 $50.00 - If a variable is set to 0 and they try to exit the webpage I want it to let t... http://guruza.com/question/423/reward-50.00 If a variable is set to 0 and they try to exit the webpage I want it to let them leave unimpeded but if the variable is set to 1 I want a function to confirm that they want to leave and if they click OK they go on their way, but if they click Cancel they stay on the page. This is the simple function that I expected would work: window.onload = function() { if(!confirm("Cancel the file transfer in progress?")) {return false} } But it lets them leave either way. I looked toward gMail's code for a guidance or a clue but found nothing that made sense to me. A solution would have to avoid leaving the page even for a moment or file transfers will be interrupted. Wed, 04 Oct 2006 22:13:20 -0700