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!