J
jkarpago
Hi,
I need to add a new function programatically.
I tried this:
var oScript = document.createElement('script');
oScript.type = 'text/javascript';
oScript.id = 'addedscript';
textNode = document.createTextNode("alert('hi');");
oScript.appendChild(textNode);
document.getElementsByTagName('head')[0].appendChild(oScript);
It works in firefox but not in ie.
Can anyone give me a solution?
thanks so much;
I need to add a new function programatically.
I tried this:
var oScript = document.createElement('script');
oScript.type = 'text/javascript';
oScript.id = 'addedscript';
textNode = document.createTextNode("alert('hi');");
oScript.appendChild(textNode);
document.getElementsByTagName('head')[0].appendChild(oScript);
It works in firefox but not in ie.
Can anyone give me a solution?
thanks so much;