Has anyone ever tried this???
Look at this example, the first one works, the second doesn't
var DAx=document.createElement('FONT')
var DAtxt=document.createTextNode('Hello')
DAx.setAttribute("color","Red"
DAx.setAttribute("ID","NewFont"
DAx.appendChild(DAtxt);
PreviewPane.appendChild(DAx);
alert(DAx.innerHTML)
Works fine, but change it to...
var DAx=document.createElement('SCRIPT')
var DAtxt=document.createTextNode("alert('Hi')"
DAx.setAttribute("language","javascript"
DAx.setAttribute("ID","NewScript"
DAx.appendChild(DAtxt);
PreviewPane.appendChild(DAx);
alert(DAx.innerHTML)
PreviewPane is a DIV element I'm using for testing. The first script places a nice red hello in the DIV, followed by an alert box, the second does NOTHING....
Any ideas or suggestions are certainly welcome.
Thanks,
Peter
Look at this example, the first one works, the second doesn't
var DAx=document.createElement('FONT')
var DAtxt=document.createTextNode('Hello')
DAx.setAttribute("color","Red"
DAx.setAttribute("ID","NewFont"
DAx.appendChild(DAtxt);
PreviewPane.appendChild(DAx);
alert(DAx.innerHTML)
Works fine, but change it to...
var DAx=document.createElement('SCRIPT')
var DAtxt=document.createTextNode("alert('Hi')"
DAx.setAttribute("language","javascript"
DAx.setAttribute("ID","NewScript"
DAx.appendChild(DAtxt);
PreviewPane.appendChild(DAx);
alert(DAx.innerHTML)
PreviewPane is a DIV element I'm using for testing. The first script places a nice red hello in the DIV, followed by an alert box, the second does NOTHING....
Any ideas or suggestions are certainly welcome.
Thanks,
Peter