Thank you, but I can't seem to find anything helpful there.
Main Topics
Browse All TopicsHi all
I have ran into a problem with Ajax which I hope you can answer.
First of all, this is my basic Ajax routine
1) I'm using the sack library (http://twilightuniverse.c
2) I'm making a call to the server and get the answer back and stored in a response property of the js sack object, let's call it
ajax.response;
3) Then I'm inserting this content into a element on the page like this:
document.getElementById('m
Now, the problem arise in IE because it won't parse javascript content in the response.
So this is my solution....which almost works:
__evaluateJs : function(obj)
{
window.jsCode = new Array();
var scriptTags = obj.getElementsByTagName('
var head = document.getElementsByTagN
for(var no=0;no<scriptTags.length;
if (scriptTags[no].src){
var head = document.getElementsByTagN
var scriptObj = document.createElement("sc
scriptObj.setAttribute("ty
scriptObj.setAttribute("sr
head.appendChild(scriptObj
}else{
var code = scriptTags[no].innerHTML;
window.jsCode[no] = code;
setTimeout('eval(window.js
}
}
}
I'm sending document.getElementById('m
This executes the javascript code.
But now comes the challenge: functions and variables inside that method are registered as member of the method where the eval() is executed. They become local variables instead of globals. I have tried to solve this by implementing a setTimeout( setTimeout('eval(window.js
I have made an example here:
http://www.dhtmlgoodies.co
it includes the file
http://www.dhtmlgoodies.co
If it works, a click on the link at the bottom should alert "20" (which it does in FF).
But IE says that "myObj is undefined".
I hope someone can help me with this problem.
Thanks a lot
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
It looks like this article is what I was looking for:
http://nerd.newburyportion
the execScript method for IE seem to solve my problem.
Business Accounts
Answer for Membership
by: vbandaruPosted on 2006-12-03 at 07:33:10ID: 18063362
Did you look at using closures in javascript
rg/en/docs /A_re- intr oduction_t o_JavaScri pt#Closure s
http://developer.mozilla.o