When I debug in IE9, It breaks on the following line
{var c=document.createElement('<iframe id="'+a+'" name="'+a+'" />')
with the following error:
SCRIPT5022: DOM Exception: INVALID_CHARACTER_ERR (5)
wmd.js, line 1 character 97
I am using OSQA software, and the bug may be reproduced with the latest version of IE9 (possibly with web developer toolbar installed)
/ (bug may be reproduced as of 1/3/12)
If you visit that page, open up the javascript console, and attempt to upload any image using the image uploader, the error occurs.
This only breaks on IE9 for some reason
Update
I'm a bit new to this javascript debugging business, but I opened up the watch menu and the value of "a" is: jUploadFrame1325624808664
When I debug in IE9, It breaks on the following line
{var c=document.createElement('<iframe id="'+a+'" name="'+a+'" />')
with the following error:
SCRIPT5022: DOM Exception: INVALID_CHARACTER_ERR (5)
wmd.js, line 1 character 97
I am using OSQA software, and the bug may be reproduced with the latest version of IE9 (possibly with web developer toolbar installed)
http://meta.osqa/questions/ask/ (bug may be reproduced as of 1/3/12)
If you visit that page, open up the javascript console, and attempt to upload any image using the image uploader, the error occurs.
This only breaks on IE9 for some reason
Update
I'm a bit new to this javascript debugging business, but I opened up the watch menu and the value of "a" is: jUploadFrame1325624808664
-
The
wmd.js
where this error occurs seem to be a 3rd party library. Report it to the library's maintainer. – BalusC Commented Jan 3, 2012 at 21:12 - 1 Since that is part of some minified javascript, I remend splitting it out for debugging. You want to be absolutely certain where the error is occurring. See jsbeautifier – Jeffrey Blake Commented Jan 3, 2012 at 21:20
3 Answers
Reset to default 9The createElement
method expects only the name of the element to create. Like this:
var c = document.createElement("iframe")
Properties can be added to the new element later:
c.id = c.name = a;
Previous versions of IE allowed you to provide this function with arbitrary HTML, but that was never part of the spec and is no longer supported in IE9.
To use createElement
, you should only give it a tag name.
var c = document.createElement('iframe');
c.id = c.name = a;
var c=document.createElement('iframe');
c.id=a;