S
steveneill
Is this an alternative to eval(). Admittidly, I have done *very* little
testing (ran it a few times in Firefox), but it seemed to work
suprisingly well with simple expressions such as "alert('hello')"
function _eval(s) {
var h = document.getElementsByTagName("HEAD")[0];
var o = document.createElement("SCRIPT");
o.text = s;
h.appendChild(o);
h.removeChild(o);
}
Any thoughts?
Steve
testing (ran it a few times in Firefox), but it seemed to work
suprisingly well with simple expressions such as "alert('hello')"
function _eval(s) {
var h = document.getElementsByTagName("HEAD")[0];
var o = document.createElement("SCRIPT");
o.text = s;
h.appendChild(o);
h.removeChild(o);
}
Any thoughts?
Steve