Connecting Tech Pros Worldwide Help | Site Map

onbeforeunload being called multiple times

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 16th, 2006, 06:15 PM
saugust@cma.com
Guest
 
Posts: n/a
Default onbeforeunload being called multiple times

Hey:

I am using the onbeforeunload as a way to indicate to the user that
they have made some changes and to give them a way to stay on the page
to complete their intended function.

This is a very simple process that is well documented throughout the
web. However, I have come across a problem that results in this event
being fired multiple times. In my particular situation, my application
has a tabbed UI where if a tab is clicked, a "redirect" function within
JavaScript is called. The window.document is "replaced" with html that
submits itself. The purpose is to take a particular URL and parse it's
query string and make hidden input buttons that will be available
within the Request object after the submit while keeping the same page.

This is where the problem occurs as the onbeforeunload is fired when
the window.document.open method is executed and all of the "write"
methods for that window.document. If I try to attach/deattach or use
variables to only allow one onbeforeunload event to be fired, the page
still navigates away.

Any ideas?


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.