Ticket #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: | |
| Blocking: | Blocked by: |
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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Additional Info:
The same issue also occurs when calling $.getJSON
Also, I am specifying the correct content type: Content-Type: text/json