The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features

See the new Forums

is there an event fired each time a node is altered, removed or added?

Forums » Dev.Opera » General Web Development Discussions

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

5. December 2011, 22:51:08

Anderssorby

Posts: 5

is there an event fired each time a node is altered, removed or added?

hi,

I'm trying to build a rich text editor using the property document.designMode="on" property, but it has some lacs when it comes to feedback from the editor or user input. Therefore, I would want to have a listener notified each time the user inputs something:
Generally, is there a way to have an event fired each time a node is altered, removed or added? (I'm referring to user input.)

5. December 2011, 23:11:54

spadija

Posts: 1643

Check here under the Mutation events section. They all start with "DOM". There is probably more information about the events elsewhere. Keep in mind though that DOM mutation events are deprecated and, to my knowledge, there is no replacement for it yet. In other words, the events may not work across all browsers, they are slow and they may not continue to work in the future.

It may not be ideal, but as an alternative, I would suggest simply listening to key strokes within the text editor.

6. December 2011, 13:13:39

Anderssorby

Posts: 5

Thanks for helping!
-I can't see why not all browsers has such a functionality implemented. It's extremely useful in for example debugging or rich text editors.

Forums » Dev.Opera » General Web Development Discussions