i have the following code on my html page:
<SCRIPT type="text/javascript">
function insertScript()
{
var sHTML="<input type=button onclick=" + "go2()" + " value='Click Me'><BR>";
var sScript="<SCRIPT DEFER>";
sScript = sScript + "function go2(){ alert('Hello from inserted script.') }";
sScript = sScript + "</SCRIPT" + ">";
ScriptDiv.innerHTML = sHTML + sScript;
}
</SCRIPT>
its working fine and showing the alert on IE9, but not on IE11.
'go2' is undefined
i have this example on the following link, any help in this regard is greatly appriciated:
http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/insertScript_2.htm