any chance to get notification on changing innerHTML

N

nick

Hi All.

I have a document loaded into browser. Later, I am loading some HTML
content (using hidden frame) and replace some part of my document with
new content, using innerHTML property.
The question is - how can I get notified when my document is changed ?

Regards,

Nick
 
D

DU

nick said:
Hi All.

I have a document loaded into browser. Later, I am loading some HTML
content (using hidden frame) and replace some part of my document with
new content, using innerHTML property.

I definitively recommend you use DOM node creating-insertion-updating
methods instead of innerHTML.
The question is - how can I get notified when my document is changed ?

Regards,

Nick

You can register a DOM mutation event on a node that you know will be
modified. Right now, the DOMNodeInsertedIntoDocument event is not
reported by any browser I know... but DOMNodeInserted is detected and
reported accordingly in NS 7.x, Mozilla 1.4+ and Opera 7.20 beta 7. (no
support in MSIE 6 for WIndows)

"DOMNodeInserted
Fired when a node has been added as a child of another node. This
event is dispatched after the insertion has taken place. The target of
this event is the node being inserted."
http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-MutationEvent

Interactive DOM 2 mutation events page:
http://www10.brinkster.com/doctorunclear/HTMLJavascriptCSS/DOM2MutationEvents.html

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,083
Messages
2,570,591
Members
47,212
Latest member
RobynWiley

Latest Threads

Top