My dynamic JS not working in IE. It is keep failing on line
newElem.innerHTML = theScript;
where theScript=alert('Hello'); which I get back from my AJAX call.
I had to go with the following workaround because javascript passed with AJAX contents was not working. Now following works ok in netscape but fails in IE.
function LoadJS(theScript)
{
var newElem = document.createElement("script");
var elemJS = document.getElementById("dinamicJScontainer");
newElem.setAttribute("language","JavaScript1.2");
newElem.setAttribute("type","text/javascript");
//IE is failing on following line.
newElem.innerHTML = theScript;
elemJS.appendChild(newElem);
};
where theScript=alert('hello');
newElem.innerHTML = theScript;
where theScript=alert('Hello'); which I get back from my AJAX call.
I had to go with the following workaround because javascript passed with AJAX contents was not working. Now following works ok in netscape but fails in IE.
function LoadJS(theScript)
{
var newElem = document.createElement("script");
var elemJS = document.getElementById("dinamicJScontainer");
newElem.setAttribute("language","JavaScript1.2");
newElem.setAttribute("type","text/javascript");
//IE is failing on following line.
newElem.innerHTML = theScript;
elemJS.appendChild(newElem);
};
where theScript=alert('hello');