B
bruce
I want to get access to some server data to be used by JavaScript. I
am using AJAX and can get the data using a client ID (<div
id=datahere></div). This works great. But, I want to use data that
ends up at "datahere" in a JavaScript function using
obj.innerHTML = xmlhttp.responseText;
Also, if I place a global of
var MyData;
and set it to
MyData = "TEMP";
Then modify the ajax routine to have
MyData = xmlhttp.responseText;
alert(MyData);
The alert does display my retrieved item but I still have "TEMP" in
MyData when I try to access it with my other function. I know it's the
'asynchronous nature of AJAX that's giving me the problem. So, what do
I need to do. I tried
<input type=hidden id=valueId value= "">
This didn't seem to work either.
Again, how to I get at the data returned from the server by AJAX in
another JavaScript function?
Thanks for the help...
am using AJAX and can get the data using a client ID (<div
id=datahere></div). This works great. But, I want to use data that
ends up at "datahere" in a JavaScript function using
obj.innerHTML = xmlhttp.responseText;
Also, if I place a global of
var MyData;
and set it to
MyData = "TEMP";
Then modify the ajax routine to have
MyData = xmlhttp.responseText;
alert(MyData);
The alert does display my retrieved item but I still have "TEMP" in
MyData when I try to access it with my other function. I know it's the
'asynchronous nature of AJAX that's giving me the problem. So, what do
I need to do. I tried
<input type=hidden id=valueId value= "">
This didn't seem to work either.
Again, how to I get at the data returned from the server by AJAX in
another JavaScript function?
Thanks for the help...