I’m working on my first ajax-driven website and have come across a curious 
problem…in one div, I replace the entire HTML content using innerHTML, with the 
new content coming from the ajax interaction.  DOM objects in that div have 
click and mouseover events attached to them, but after I replace the HTML they 
no longer work even though the HTML has identical objects (names/ids/etc.).  So 
I had to write a small bit of JavaScript to hook the new elements back up after 
they were replaced and got to thinking…before making the ajax call, should I 
detach event handlers from existing DOM elements that will be replaced, make 
the call, replace the HTML, and then hook them back up?  Does anyone else do 
this?  I googled for quite a bit but couldn’t come up with a decent set of 
search terms that would narrow the results down enough to find out what other 
people were doing…

To tie it into a DW group, I use DW8 to do all my coding…  ☺

Thanks,

Tim


____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
       Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to $subst('List.Name') as: 
$subst('Recip.EmailAddr')
To unsubscribe send a blank email to $subst('Email.UnSub')
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to