View Single Post
07-21-2010, 08:27 PM
#1
Jordan Street is offline Jordan Street
Status: Member
Join date: Dec 2005
Location: Tampa Fl
Expertise:
Software:
 
Posts: 214
iTrader: 0 / 0%
 

Jordan Street is on a distinguished road

Send a message via AIM to Jordan Street Send a message via MSN to Jordan Street

  Old  AJAX limitation on local machine

Hey guys I'm running a script that is just sitting on my desktop.

Code:
function getfile(filename)
{
  	xmlhttp=new XMLHttpRequest();
	xmlhttp.open("GET",filename,false);
	xmlhttp.send();
	
	return xmlhttp.responseText;
}
this works in firefox but not chrome or IE

if I try and create a callback function ala

Code:
function getfile(filename)
{
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    responsetext = xmlhttp.responseText;
    }
  }
xmlhttp.open("GET",filename,true);
xmlhttp.send();

return responsetext;
}
it doesn't work in any of them

thoughts?

Reply With Quote