anujgarg Posted February 23, 2008 Share Posted February 23, 2008 hi, I am returning a value from one ajax function. But I am unable to retrieve it in another one. Here is the code: function showDiv() { var strURL="findSubProg.php"; var req = getXMLHTTP(); req.open("GET", strURL, true); req.send(null); alert(req.responseText); return req.responseText; } function showDiv1(showId) { var myvar = showDiv(); alert(myvar); } Here in second function, I am getting a blank alert message. But it shows values in function showDiv(). How can I get those values in variable 'myvar' returning from showDiv() ? -- Anuj Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.