id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,blockedby,blocking 12697,Node creation fails for Chrome in XHTML under certain conditions,Sorensen,Sorensen,"When using XHTML and serving the page as application/xhtml+xml, node creation fails under certain conditions and bombs out with a DOM syntax error. This has been tested in Chrome 22 and Firefox 14 on Windows 7 using jQuery 1.8.2. The problem is only present in Chrome. Firefox handles things fine. As far as I have tested, this ONLY works when the page is served as application/xhtml+xml, which means I can't get a proper unit test for it. However, if you have access to a server that dishes out the page with the proper MIME type, it's an easy setup. The problematic code is $(''). Note that the tag element is not self-closed, and that an attribute is present. If the element is self closed, or if the attribute is not present, no problem happens. E.g., $('') is okay, and $('') is okay. As far as I have tested, any combination of tag, attribute, and attribute value exhibits this behavior. When $('') is executed, Chrome barfs with SYNTAX_ERR: DOM Exception 12. The following is the stack trace using the non-min version. {{{ Error: An invalid or illegal string was specified. at Function.jQuery.extend.clean (jquery.js:6312:20) at Function.jQuery.buildFragment (jquery.js:6151:10) at Function.jQuery.extend.parseHTML (jquery.js:499:19) at jQuery.fn.jQuery.init (jquery.js:131:24) at jQuery (jquery.js:44:10) at Document. (http://localhost:8080/Test/testpage.jsp:29:6) at fire (jquery.js:974:30) at Object.self.fireWith [as resolveWith] (jquery.js:1082:7) at Function.jQuery.extend.ready (jquery.js:406:13) at Document.DOMContentLoaded (jquery.js:83:11) }}} The line that blows up is 6312: {{{ div.innerHTML = wrap[1] + elem + wrap[2]; }}} Here's a simple .jsp page that can be used as a test case: {{{ <%@page contentType=""application/xhtml+xml"" pageEncoding=""UTF-8"" %> }}} If a .jsp server isn't available, simply replace the <%@page %> declaration with whatever you'd use to serve the page as application/xhtml+xml in your language/framework. I don't know if something changed with jQuery or with Chrome, but the problem first cropped up when I upgraded from jQuery 1.7.1. Regards, Evan PS, tell Askimet that this is not spam! ",bug,closed,undecided,None,unfiled,1.8.2,notabug,,,,