Cant append "used" DOMObject in IE

Posted by Kein on Stack Overflow See other posts from Stack Overflow or by Kein
Published on 2010-06-02T09:04:47Z Indexed on 2010/06/02 10:33 UTC
Read the original article Hit count: 188

I have some objects, that keep created DOMObjects, like here:

function category(){
    var domBlock;
    this.block = function(){
        if (!domBlock){
           // Here dom-object constructor $('<div></div>'); etc
        }
        return domBlock; // jquery object,
               // but i test and native document.createElement
    }
 }

Then i clear category's area, and append old and new received(with Ajax) objects:

area.html('');
for(id in category_list){
     area.append( category_list[id].block() );
}

where category_list is list that contain category objects. Area is jQuery object.

In other browsers (except IE) i get area with all needed categories, but in IE i get only new received categories(that just create DomObject), other old objects that keeped old DomObject not show.

I know it possible make with innerHTML, but i wont keep DomObject, not text. Because DomObject keep many events. And it very hard for browser attach events for each DomObject after refresh area.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery