Link to home
Start Free TrialLog in
Avatar of razzzzer
razzzzer

asked on

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
Avatar of basicinstinct
basicinstinct
Flag of Australia image

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...
Avatar of razzzzer
razzzzer

ASKER

yup all files are located on a server and in the same folder
all files have the same .asp extension

thanks
ASKER CERTIFIED SOLUTION
Avatar of Kiran Paul VJ
Kiran Paul VJ
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
just had to remove the onreadystatechange method and add the code like they suggested...

thanks guys

rich