Randy Webb wrote:[color=blue]
> Inserting script code via innerHMTL won't execute it (only in NS6 did
> that work). If you want to execute script code, you are going to have to
> load it separately, use createElement to create a script block, then
> appendChild to append that script block to a node for it to execute in
> any modern browser.
>
> --
> Randy
> comp.lang.javascript FAQ -
http://jibbering.com/faq & newsgroup weekly
> Temporarily at:
http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
> Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/[/color]
Randy, is there a way I can do it with the innerHTML that I am passing
instead of using the create element? I create a calendar object in the
calling page and this is not behaving at all....I was trying to do this
but it was not working...
When I populate the span I am using....
result = http_request.responseText;
result = execJS(result);
document.getElementById('call_results').innerHTML = result;
exec function...
function execJS(node) {
var st = node.getElementsByTagName('SCRIPT');
var strExec;
for(var i=0;i<st.length; i++) {
strExec = st[i].text;
try {
eval(strExec);
} catch(e) {
alert(e);
}
}
}
It hiccups on the getElementsByTagName I know why but what else can I
use, when i alert node string it has all of the page that I am using to
populate the page but I cannot get this final piece to work, I have
been reading that I can use the eval function in this case here -
http://microformats.org/wiki/rest/ah...ing_Javascript
Any ideas?