Hi,
I am trying to append a <script> tag to a div at runtime. The script has a function. But I am getting the following error on IE:
Unexpected call to method or property access.
It works in Firefox. Can anyone please help me.
var script = document.createElement("script") ;
script.setAttribute("language", "javascript") ;
var functionText = "function
test(){alert('hello')}" ;
script.appendChild(document.createTextNode(functionText)) ; // this statement gives the error.
Thanks and regards,
AmIt Sanghai.