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 45 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

AJAX limitation on local machine

Thread title: AJAX limitation on local machine
Reply    
    Thread tools Search this thread Display Modes  
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
07-21-2010, 08:59 PM
#2
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,892
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

Use jQuery, it is easier to work with and works on all browsers. jQuery is well documented, you can go to http://jquery.com/ to see it.

Reply With Quote
07-21-2010, 11:49 PM
#3
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

Thanks for the recommendation I checked it out, very nice. Since this script is only going to ran on firefox though (it uses iMacros) It's not a big deal I guess. I'm also using XPCOM to write files so thats another firefox specific thing.

thanks again for the link

Reply With Quote
Reply    


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