Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#6144 closed bug (invalid)

ajax success broken

Reported by: tuomo Owned by:
Priority: Milestone: 1.4.2
Component: ajax Version: 1.4
Keywords: Cc:
Blocked by: Blocking:

Description

Hello. I use jQuery ajax request in this way:

function sendData(url, callback) {

var values = getPageData(); var encoded = $.toJSON(values);

$.ajax({

type: "POST", url: url, data: encoded, success: callback, dataType: "json"});

}

With very large responses(>100kB) the success function is never called. If response is small, the success function works fine. I don't have any problems with jQuery 1.3.2, the problem is with versions 1.4.2 and 1.4.1

Change History (6)

comment:1 Changed 10 years ago by john

Resolution: invalid
Status: newclosed

It's likely because your JSON is malformed, more information here: http://yehudakatz.com/2010/01/15/jquery-1-4-and-malformed-json/

comment:2 Changed 10 years ago by tuomo

Resolution: invalid
Status: closedreopened

comment:3 Changed 10 years ago by john

Resolution: invalid
Status: reopenedclosed

Uhh - why was this reopened? Please don't reopen the ticket unless you have something to add.

comment:4 Changed 10 years ago by tuomo

I'm pretty sure that my JSON is valid. I pasted my server result to JSON validator http://jsonlint.com/, and the test passed.

There is my server response, this is the valid JSON string. And I can't get it work with jQuery 1.4.2, with 1.3.2 it works fine!

I can send my problematic server response to you with mail...

comment:5 Changed 10 years ago by tuomo

You were right John. My JSON is malformed.

comment:6 Changed 10 years ago by andras

Please, check if there's an error. I was parsing strings like "\xFA" which is invalid JSON. Correct version is "\u00FA". An exception wasn't being thrown and success function wasn't being called either.

Note: See TracTickets for help on using tickets.