Click here to Skip to main content
14,732,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,
I have written a function on onbeforeunload which uses setTimeout('myclose=false',100); - which should set the myclose variable as false afte 100ms interval.
But when I navigate to some other page from this page, it sometimes is not set as false and remains true - this behaviour is uncertain but usual one.
The strange thing is that when I put breakpoint in visula studio and just debug linebyline , it is set set to false always.
So i added sleep for 2000ms, afte settimeout call, but all in vain ...
So what can be the reason ?
- Ajay Kale

1 solution

Should you not have the code as;

setTimeout( function () { myClose=false } , 100);

[Edit: oops, missed out the function()]
Dalek Dave 31-Aug-10 9:16am
Beat me to the correction! :)
DaveAuld 31-Aug-10 9:23am
DD, ha ha....[nelson style]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900