HIERARCHY_REQUEST_ERROR(3) appending XHTML DIV into XHTML DIV on IE
|Reported by:||Jason R. Coombs||Owned by:||Jason R. Coombs|
I originally created this post in the forums to better understand why I was unable to load an XHTML document element into another XHTML document node using jQuery 1.5.2 on IE. I've since concluded that to the best of my understanding, jQuery doesn't support loading an XHTML node into another XHTML document unless the new node is coerced into HTML (such as through the 'html' parameter to get).
It should be possible to load an XHTML document that has XML headers on it (such as a <!DOCTYPE> or preprocessing instruction) and add it (or a subnode) to another XHTML document. The following describes a simple example to reproduce the error.
Here's a harness with a script that performs a dynamic load of an XHTML file:
And widget.xhtml that it tries to load:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <div xmlns="http://www.w3.org/1999/xhtml" xmlns:other="http://example.com/other"> <other:foo /> Got it! </div>
The code works on Firefox 4 and Chrome, displaying "Got it!" in the document. On IE, however, it fails with the HIERARCHY_REQUEST_ERROR(3) during the .append call.
As I mentioned in the forum, I can make it work if I remove the <!DOCTYPE> and force HTML processing by passing 'html' to the .get call and remove the reference to 'documentElement'.
Change History (14)
comment:2 Changed 6 years ago by
|Component:||unfiled → ajax|
|Priority:||undecided → low|
|Status:||new → closed|