Bug Tracker

Opened 16 years ago

Closed 16 years ago

#1740 closed bug (worksforme)

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

Change History (3)

comment:1 Changed 16 years ago by dancablam

Additional Info:

The same issue also occurs when calling $.getJSON

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

comment:2 Changed 16 years ago by dancablam

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!

comment:3 Changed 16 years ago by davidserduke

need: PatchReview
Resolution: worksforme
Status: newclosed

Author has reported it works for him so closing.

Note: See TracTickets for help on using tickets.