#3071 closed bug (invalid)
NO_MODIFICATION_ALLOWED_ERR with XHTML mime type
Reported by: | parrots | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | plugin | Version: | 1.2.6 |
Keywords: | simplemodal | Cc: | |
Blocked by: | Blocking: |
Description
In safari 3.1 on Mac I get the following error: Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7
This occurs when using SimpleModal 1.1.1 (googling the error shows it happening with multiple plugins, though). Example of code usage can be found at http://www.nationalscholastic.org/headcount/meet/41 (although currently I've reverted the mime type to text to prevent this error)
This only started to happen once I changed the mime type for my pages to application/xhtml+xml. It seems to be caused by "div.innerHTML=wrap[1]+elem+wrap[2];" on line 22 (of the minified code). My assumption is that it doesn't like using innerHTML.
Change History (4)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
In the SimpleModal source, try changing instances of:
$('<div>')
with:
$('<div/>')
comment:3 Changed 15 years ago by
Component: | core → plugin |
---|---|
Keywords: | simplemodal added |
Resolution: | → invalid |
Status: | new → closed |
It's logical that xml pages require correct html strings. I'll close now, please let the owner of SimpleModal know about this so it can be fixed.
comment:4 Changed 11 years ago by
Replying to parrots:
In safari 3.1 on Mac I get the following error: Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7
This occurs when using SimpleModal 1.1.1 (googling the error shows it happening with multiple plugins, though). Example of code usage can be found at http://www.nationalscholastic.org/headcount/meet/41 (although currently I've reverted the mime type to text to prevent this error)
This only started to happen once I changed the mime type for my pages to application/xhtml+xml. It seems to be caused by "div.innerHTML=wrap[1]+elem+wrap[2];" on line 22 (of the minified code). My assumption is that it doesn't like using innerHTML.
I am getting a similar error:
The following contents saved as somepage.xhtml
will throw
jquery-1.6.2.js:6111 NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7: An attempt was made to modify an object where modifications are not allowed. in safari.
which is line div.innerHTML = wrap[1] + elem + wrap[2]; in the jquery-1.6.2.js
Thanks Jeff [email protected]…
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xmlns:trav="http://www.aaa.com/jsf/facelets/travel" xmlns:spry="http://ns.adobe.com/spry">
<head>
<title>somepage </title> <meta name="DESCRIPTION" content="ebooks_metaDescription" /><meta content="All rights reserved." name="copyright" />
<script type="text/javascript" src="/jsincludes/jquery/jquery-1.6.2.js" language="javascript"></script>
<script type="text/javascript" src="/jsincludes/jquery/1.0b2/jquery.mobile-1.0b2.js" language="javascript"></script>
</head> <body>
</body> </html>
A bit more playing around and it seems the error is caused by Safari trying to validate the innerHTML content (which makes sense since the page is being sent as XML and that should be valid). SimpleModal was trying to set the innerHTML to "<div>" first, and then to the actual content in a second call. Setting it to "<div>" is what was failing since the closing tag was missing. Not sure where the fault lies here, JQuery or SimpleModal.