Description
Original report from user list (Admirolas):
Hello,
I have tried my JSF application, that uses MyFaces Tomahawk 1.1.10 with Internet Explorer 9. After click on calendar button I get JavaScript error: DOM Exception: INVALID_CHARACTER_ERR (5). IE9 JavaScript debugger shows, that exception is thrown in calendar/popcalendar.js line 164. There is call to: document.createElement and passes html tag as parameter.
Maybe there is some workaround? A patch? Should I migrate to 1.2.10?
The problem is this line (popcalendar.js):
iframe = document.createElement(
"<iframe"
+ " src='javascript:false;'"
+ " id='" + overDiv.id + "_IFRAME'"
+ " style='visibility:hidden; position: absolute; top:0px;left:0px;'"
+ "/>");
IE9 is more strict, and this code does not work. The solution is do this instead:
iframe = document.createElement("iframe");
iframe.setAttribute("id", overDiv.id + "_IFRAME'");
iframe.setAttribute("src", "javascript:false;")
Element.setStyle(iframe, "visibility:hidden; position: absolute; top:0px;left:0px;");
Tested in IE6, IE8, IE9, Firefox 3.6.17 and Opera 10.10. Also checked quirksmode dot org compatibility table.