__defineSetter__ on innerHTML stops it from rendering

Posted by Tokimon on Stack Overflow See other posts from Stack Overflow or by Tokimon
Published on 2010-05-27T10:14:07Z Indexed on 2010/05/27 11:21 UTC
Read the original article Hit count: 174

Filed under:
|
|

Hi,

i'm trying to create a watch method for HTML elements, using __define[GS]etter__ when a property is changed. It reacts just fine when i set the value, but if the property listened to, is innerHTML, it somehow fails to render the given string. So basically, when im adding something to innerHTML it doesn't show.

Im using the watch method described in this previous question: http://stackoverflow.com/questions/1269633/javascript-watch-for-object-properties-changes

I could of cause just not listen to innerHTML changes, but i'm also wondering if the __defineSetter__ somehow prevents original handling of setting the value.

Thanks!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about innerhtml