#534 closed bug (fixed)
success-event not fired on synchronous AJAX events on FF (with fix)
Reported by: | void | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.1a |
Component: | ajax | Version: | |
Keywords: | onreadystatechange, firefox | Cc: | |
Blocked by: | Blocking: |
Description
If you do an non-asynchronous AJAX request, like so:
$.ajax({'async':false,'url':'ajax.txt',success:function(data){alert(data)}});
then the 'success' function is not called on FireFox (1.5.0.8 on WinXP). This is because Firefox does not fire the 'onreadystatechange' event on synchronous ajax calls. The fix is easy, just change 2 lines of code:
Line 1975 in jquery-1.0.4.js:
if(s.async) xml.onreadystatechange = onreadystatechange;
Line 1994 in jquery-1.0.4.js:
if (!s.async) onreadystatechange();
Change History (6)
comment:1 Changed 16 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 Changed 16 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
The problem does persist... If you search Google Groups, you will find many reports about this issue: Firefox does not fire the onreadyStateChange on syncrhonous AJAX requests.
Examples: Example1 and Example2
Once again, my example is this:
$.ajax({async:false,url:'ajax.txt',success:function(data){alert(data)}});
Tested on FF 1.5.0.9 on WinXP and on FF 1.5.0.7 on Linux: both do not call the 'success' function.
Please test it as in this example, I'm sure you will find the same results. Thanks!
comment:3 Changed 16 years ago by
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
Your example works just fine. Did you try if it works with "async: true"? Maybe the problem is elsewhere. Otherwise: Please setup a test page that clearly shows the problem.
comment:4 Changed 16 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Alright, here's the online example for ya:
http://zooi.arjan.webpower.nl/jquery/
Need more info? I am more than willing to answer your questions. Contact me at arjan -the well known separator- avoid dot org
comment:5 Changed 16 years ago by
Interesting. My guess: This was fixed in FF 2, therefore it works for me. Got to install FF 1.5 again.
comment:6 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed in SVN. It is a FF1.5 only-problem, but now handled by jQuery.
I can't confirm this (with FF 1.5.0.9). This is the test code:
Please reopen if the problem persists.