Bug Tracker

Modify

Ticket #6144 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

ajax success broken

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

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

comment:1 Changed 3 years ago by john

  • Status changed from new to closed
  • Resolution set to invalid

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 3 years ago by tuomo

  • Status changed from closed to reopened
  • Resolution invalid deleted

comment:3 Changed 3 years ago by john

  • Status changed from reopened to closed
  • Resolution set to invalid

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

comment:4 Changed 3 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 3 years ago by tuomo

You were right John. My JSON is malformed.

comment:6 Changed 3 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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.