tags:

views:

452

answers:

1

I am having some strange problems loading content from another XHTML page via jQuery. When the second page I try to load from is served as XHTML I get the below error. I don't know if it helps but both documents validate when I get the error.

Uncaught Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7

Currently the header on the second page I load from is:

<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 <meta name="language" content="en" />  
 <title>some title</title>
 <!-- CSS & Javascript included here -->
</head>

The content type is set as:

application/xhtml+xml;charset=iso-8859-1

Interestingly, when I remove all the XHTML stuff from the header and stop setting the content type the error does not occur and everything works great.

The load process currently looks like the below. It works fine when everything is plain HTML.

$('#overpage').find(".wrap").load(this.getTrigger().attr("href")+" #op").show();

I'm curious why the process only does not work when the second page I load from is XHTML. I don't want to serve the page as just plain HTML and am looking for advice on what I am doing wrong. Both pages validate and I'm really scratching my head here. Many thanks!

+2  A: 

I think this is related to the fact that document.write does not work with XHTML strict:

http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite

Alex Black