Search Results

Search found 2 results on 1 pages for 'tokimon'.

Page 1/1 | 1 

  • IE 8 remove line break between nodes with JavaScript

    - by Tokimon
    Ok i have a list of HTML nodes which should be inline with no spacing between them. The problem is, that the nodes are written from a CMS and therefore will come with all sorts of linebreaks and spaces. Therefore I'm removing the spaces with JS using the method descibed in this question. The problem is, however, that in IE (not 9) the white spaces isn't part of the childrens list of the parent node, rendering the method useless in IE. However IE 7 (or at least IE 9 emulating IE 7) ignores the linebreaks, so that one is in the clear. That leaves IE 8 as the troublemaker. I discovered that the line break is actually a part of the outerHTML and that a simple reset of the outerHTML did the trick - like so: node.outerHTML = node.outerHTML However this will reset the node intirely and therefore removing all events and other settings on the node, which isn't really any good. So my question is now: Is there a way to remove that linebreak from the nodes outerHTML whitout resetting the node? I've tried with zoom: 1, but to no avail. Hope anyone has any experience with this.

    Read the article

  • __defineSetter__ on innerHTML stops it from rendering

    - by Tokimon
    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!

    Read the article

1