Skip to main content

Bug Tracker

Side navigation

#1740 closed bug (worksforme)

Opened September 26, 2007 11:11PM UTC

Closed December 04, 2007 08:32AM UTC

JSON Data Truncated When Calling $.ajax Funciton

Reported by: dancablam Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: json ajax Cc:
Blocked by: Blocking:
Description

When calling an AJAX request like so:

$.ajax({

type: "GET",

url: "script.php",

dataType: "json",

cache: false,

async: false,

success: function(data){

obj = data;

}

});

The $.ajax function will only process approximately 50 characters of the return string, ignoring the rest.

Example JSON Response:

{"layer":"48","type":"text","width":43,"height":9,"ratio":0.209302326,"r":1,"g":2,"b":3}

The above JSON string will return: Object layer=48 type=text width=43 height=9 - and will ignore the remainder of the string.

This does note appear to be an issue with the format of the JSON response - if I remove layer, type, width, and height from the above string, then ratio and the remainders will display (up to the next 50 characters).

I have also attempted this response with async set to true - same issue.

Please advise.

Many thanks,

Dan

Attachments (0)
Change History (3)

Changed September 26, 2007 11:20PM UTC by dancablam comment:1

Additional Info:

The same issue also occurs when calling $.getJSON

Also, I am specifying the correct content type: Content-Type: text/json

Changed September 26, 2007 11:48PM UTC by dancablam comment:2

ISSUE RESOLVED

Problem was traced to my debugger program, which was not reporting all elements returned in the created object, jquery was NOT at fault. Please close and thanks!

Changed December 04, 2007 08:32AM UTC by davidserduke comment:3

need: PatchReview
resolution: → worksforme
status: newclosed

Author has reported it works for him so closing.