Support for XHTML documents?
Something funny happens when you serve an XHTML document as XHTML "application/xhtml+xml" as recommended. AJAX libraries, scripts, and styles seem to fall apart.
jQuery's documentation for individual methods is littered with comments about lack of support for XML documents like:
"Note: this method currently does not provide cross-platform support for setting data on XML documents, as Internet Exp开发者_运维百科lorer does not allow data to be attached via expando properties."
or the more direct
"This method is not available on XML documents."
Mozilla also mentions that "document.cookies does not exist in XML documents" and "document.write is not supported in XML documents". Meanwhile, there's a final recommendation to "not use inline style or script in XHTML" at all.
This lack of support/features for XML/XHTML documents (with MIME type "application/xhtml+xml") in AJAX libraries and browsers is disappointing and alarming.
Where can I find an overview of how handicapped the jQuery API is when working with XHTML documents? Or perhaps a comparison of features available on the document object between an HTML document and a properly served strict XHTML document?
Not sure if I'm on the same track, but I've come across the following being used to assist XHTML/jQuery operations:
<a4j:loadScript src="resource://jquery.js"/>
Hope this is of some use :)
精彩评论