开发者

Listen for changes in a DOM structure

开发者 https://www.devze.com 2023-01-22 07:57 出处:网络
Is there any standardized way (not language dependent, I need at least C++, Java and Ruby) of listening for changes in a DOM-document? I开发者_运维知识库 would like to have a function called every tim

Is there any standardized way (not language dependent, I need at least C++, Java and Ruby) of listening for changes in a DOM-document? I开发者_运维知识库 would like to have a function called every time a node's attributes change, a node gets renamed, deleted, etcetera.

I found the Handlers for UserData, however those don't allow me to listen for e.g. changes in attribute. Right now it seems to me the only possibility is implementing my own DOM. Any ideas?


You want to add a handler for Mutation Events. I've used these in Firefox, although I don't know what availability they have in libraries for the languages you mention.

http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号