• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2246
  • Last Modified:

Firefox Ajax xmlhttp.open problem

howdy experts...

I have run into an issue with Firefox browser and an Ajax call.
xmlhttp.open("GET",url1,true)
vs
xmlhttp.open("GET",url1,false)

i wanted to have the function run with the async status false but it appears that Firefox will not run it (Works in IE and Safari).  Does Firefox have a problem with the setting false?  seems to run if set to true but because I have a number of things going on in the page setting false seems to work better...

thanks
rich
0
razzzzer
Asked:
razzzzer
  • 3
  • 2
  • 2
2 Solutions
 
basicinstinctCommented:
ajax is a bit "funny" when running under the "file:" protocol (ie your test page is running on the local file system).  make sure you run your test page on a webserver...
0
 
razzzzerAuthor Commented:
yup all files are located on a server and in the same folder
all files have the same .asp extension

thanks
0
 
Kiran Paul VJComputer EngineerCommented:
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
razzzzerAuthor Commented:
thanks kiranvj....

"But Firefox does not fire onreadystatechange events in that case so
you need to put your code processing the response after the send call"

not exactly sure what is ment by this line...

if my code is like so:

xmlhttp.onreadystatechange=loadList1;
xmlhttp.open("GET",url1,false);
xmlhttp.send(null);

have a suggestion to make it fire?
the code runs much much smoother set to false but i guess i could check for firefox and set to true just for that browser?  any other suggestion?

thanks
0
 
basicinstinctCommented:
you know, i never have these problems, and you know why? cos i let someone else fix them all for me...  one word (ok two words) "ajax library"...

there are HEAPS of them around... for starters:

http://www.prototypejs.org/
http://jquery.com/

They are really easy to use and abstract you away from all of these browser specific implementation issues resulting in more robust code and freeing you up to spend more time on the real business of the task at hand...
0
 
razzzzerAuthor Commented:
just had to remove the onreadystatechange method and add the code like they suggested...

thanks guys

rich
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now