Bug Tracker

Opened 13 years ago

Closed 11 years ago

#1407 closed bug (invalid)

I got a bug about method append()/appendTo()

Reported by: AvengerBevis Owned by:
Priority: critical Milestone: 1.1.4
Component: build Version: 1.1.3
Keywords: Cc:
Blocked by: Blocking:

Description

This is code :

<script src="jquery.js"></script>
<script>
	function domToString(dom){
		if(!dom) return "";
        if($.browser.msie)
            return dom.xml;
        return (new XMLSerializer()).serializeToString(dom);
    }
	function stringToDOM(xmlString){
		if(!xmlString || typeof xmlString != 'string') return null;	
        var xmlDom;
        if($.browser.msie){//IE{
            xmlDom = new ActiveXObject("Microsoft.XMLDOM"); 
            xmlDom.loadXML(xmlString);  
        }else if(DOMParser) { //Mozillia Gecko
             xmlDom = new DOMParser().parseFromString(xmlString,'text/xml');
        } // end if
        return xmlDom;
    } 
	var dom = stringToDOM('<?xml version="1.0" encoding="UTF-8"?><root></root>')
	$('<son></son>').appendTo($(dom).find('root'));
	alert(domToString(dom))
</script>

Please save it as htm(l) and run it in MSIE and Firefox

I got defferent results : MSIE can not append the node to DOM but firefox can

My project was worried about this bug If you got a solution , please email me and tell me how can i do. I'm waiting...

Change History (2)

comment:1 Changed 13 years ago by AvengerBevis

I find why it does not work $('<son></son>').length is 0

Why $('<div></div>').length is 1 but <son> is 0?

comment:2 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.