I have an application that works on IE browser only. I have an issue with the application running on IE10 with IE 5 quirks document mode.
I am trying to write some JavaScript, that I receive from my server, into the page using JavaScript, but I found that when the page is in IE 5 quirks mode, an error is thrown by the browser. However, when I attempt to do the same in Quirks mode, the script works fine.
I cannot switch to quirks mode, because the application is not-usable (the entire page is not viewable, controls inaccessible) in Quirks or standards mode.
Following is the script that I am trying to get executed:
var scr = document.createElement('script');
scr.type = 'text/javascript';
scr.innerText = 'function Test123(){alert("123");}'; //this is the line that throws the exception
document.body.appendChild(scr);
Could anyone please let me know how to get the above script executed in IE 5 quirks mode?
The issue was resolved by setting the text property instead of the innerText property.