Side navigation
#534 closed bug (fixed)
Opened December 17, 2006 10:08AM UTC
Closed December 29, 2006 01:51PM UTC
Last modified October 14, 2008 10:29AM UTC
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();
Attachments (0)
Change History (6)
Changed December 21, 2006 12:54PM UTC by comment:1
resolution: | → worksforme |
---|---|
status: | new → closed |
Changed December 25, 2006 01:57PM UTC by comment:2
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:
and
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!
Changed December 28, 2006 12:39PM UTC by comment:3
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.
Changed December 28, 2006 02:31PM UTC by comment:4
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
Changed December 29, 2006 12:02PM UTC by comment:5
Interesting. My guess: This was fixed in FF 2, therefore it works for me. Got to install FF 1.5 again.
Changed December 29, 2006 01:51PM UTC by comment:6
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.