Side navigation
#6294 closed bug (worksforme)
Opened March 16, 2010 01:38AM UTC
Closed October 01, 2010 03:25AM UTC
jQuery1.4.2 ajax bug
Reported by: | zhanghuihua | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.4.3 |
Component: | ajax | Version: | 1.4.2 |
Keywords: | jQuery1.4.2 | Cc: | |
Blocked by: | Blocking: |
Description
jQuery.ajax({
type: "POST",
url: url,
data: data,
success: callback,
dataType: type
});
if dataType is "json", then connot call callback function.
default dataType is OK.
Attachments (1)
Change History (4)
Changed March 16, 2010 01:43AM UTC by comment:1
Changed March 18, 2010 12:37AM UTC by comment:2
resolution: | → invalid |
---|---|
status: | new → closed |
I was unable to read the test page to see how to submit an ajax request. The most likely cause of a problem with json from 1.3 to 1.4 is that the site is not producing valid json:
VALID: {"test": "string"}
INVALID: { test: "string"}
INVALID: { 'test': "string"}
INVALID: { "test"": 'string'}
Changed March 22, 2010 06:42AM UTC by comment:3
resolution: | invalid |
---|---|
status: | closed → reopened |
jQuery.post( url, [ data ], [ success(data, textStatus, XMLHttpRequest) ], [ dataType ] )
Connot call success callback function, when dataType is "json" the jQuery version is 1.4.2.
Please download the attachment "ajax-bug.zip" and open "json-test.html" on IE or firefox.
Changed October 01, 2010 03:25AM UTC by comment:4
priority: | → undecided |
---|---|
resolution: | → worksforme |
status: | reopened → closed |
The problem with your original example is that you were attempting to parse/load malformed JSON structures using $.post. If you take a look at your original file (ajaxDone.html) you will see this.
I've uploaded a correctly formed JSON example here, being loaded by your original code, save for the output being different due to the change in JSON file.
http://www.addyosmani.com/jquery/6294/json-test.html
As you can see in FireFox, this is working fine using jQuery 1.4.2.
Closing this ticket as it is not a bug.
I just update jQuery RIA framework from jQuery1.3.2 to 1.4.2, connot call callback function.
Demo url: http://dwz.duqn.com/
jQuery.ajax({
type:"POST", url:url, data:{}, success:callback, dataType:"json"
});