JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
detecting DOM change event Posted by Josh Code on 7 May 2008 at 8:24 AM
I want to somehow detect when the DOM of a page is changed in any way whether it be text replacement, moving a node, removing or adding a new node... and have a JavaScript function to react to a change in some way. The specific way I react shouldn't be important to explain.

I have a brute force solution which involves storing a disconnected copy of the DOM and comparing them on a small time interval. Differences lead to the copy being updated to match once again and the event handler function called.

So I have an inefficient, overly complex solution but do you know of an easier, more efficient way to detect a DOM change?
Report
Re: detecting DOM change event Posted by zibadian on 7 May 2008 at 8:33 AM
: I want to somehow detect when the DOM of a page is changed in any
: way whether it be text replacement, moving a node, removing or
: adding a new node... and have a JavaScript function to react to a
: change in some way. The specific way I react shouldn't be important
: to explain.
:
: I have a brute force solution which involves storing a disconnected
: copy of the DOM and comparing them on a small time interval.
: Differences lead to the copy being updated to match once again and
: the event handler function called.
:
: So I have an inefficient, overly complex solution but do you know of
: an easier, more efficient way to detect a DOM change?

Perhaps this works for you: http://w3schools.com/htmldom/event_onchange.asp
I'm not sure if all DOM objects implement this event.
Report
Re: detecting DOM change event Posted by borisreitman on 18 Aug 2008 at 10:09 AM
Have you solved the problem ?
Report
Re: detecting DOM change event Posted by PeterTheMaster on 16 Jun 2010 at 4:26 AM
i am interested in that reply too.
Report
This post has been deleted. Posted by PeterTheMaster on 16 Jun 2010 at 4:27 AM
This post has been deleted.
Report
This post has been deleted. Posted by PeterTheMaster on 16 Jun 2010 at 4:27 AM
This post has been deleted.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.