Opened 16 years ago
Closed 14 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 16 years ago by
comment:2 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
I find why it does not work $('<son></son>').length is 0
Why $('<div></div>').length is 1 but <son> is 0?