Jump to content

Cannot get return to work...


aximbigfan

Recommended Posts

I have been trying for a long time, I just want this function to return a var, but no matter what, it doesn't work.

 

function ajax(url)
{
var http = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();

http.onreadystatechange = function()
{
if (http.readyState == 4)
{
if (http.status == 200)
{
return http.responseText;
}
else
{
alert("AJAX Error! \nReturned Text: "+ http.statusText);
}
}
}

http.open("GET" ,url , true);
http.send(null);
}

 

Anyone?

 

Thanks,

Chris

 

Link to comment
https://forums.phpfreaks.com/topic/98554-cannot-get-return-to-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.