Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- onbeforeunload help!


suga - 5:11 pm on Apr 1, 2009 (gmt 0)


i am new to javascript, so thanks in advance. i've created a form for a user to complete, but i want to warn them if they leave the particular page without completing the form. i've added onbeforeunload, but the warning appears even when the page is refreshed, which is not what i want.

is there any way to check in javascript whether the next requested page equals the current page (i.e. page refresh or a call to the same page)? location.href == ?

thanks!


Thread source:: http://www.webmasterworld.com/javascript/3883249.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com