开发者

Javascript custom onread events

开发者 https://www.devze.com 2023-03-15 15:14 出处:网络
I need to somehow catch an event when the data is being read from the DOM. For instance, textarea.value, div.innerHTML and etc. I tried somehow override these prototype properties, but with no s开发者

I need to somehow catch an event when the data is being read from the DOM. For instance, textarea.value, div.innerHTML and etc. I tried somehow override these prototype properties, but with no s开发者_JS百科uccess, it's not that simple like overriding prototype methods.

Did anyone encounter this problem and find solution? Any help would be appreciated!


OK, so I found this interesting article by John Resig which suggests it can be done. I put together this fiddle as a test and it seems to work, however I haven't tried extending this for use on DOM object properties yet. Also, I'm not sure quite how cross-browser it is, but maybe it could help give you some ideas to explore?

0

精彩评论

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