Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,256
Total Threads: 81,171
Total Posts: 566,848
There are 43 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

AJAX limitation on local machine

Thread title: AJAX limitation on local machine
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
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
     


Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed