Invalid JSON alert, JSON data is valid
Invalid JSON alert, JSON data is valid
Ugh, this is frustrating. I'm passing JSON data back using server side processing.
I'm getting the "json data from server failed to load or be parsed" message. I'm returning this data from a Java Servlet. My content type is defined as "application/json" and I also tried x-json.
Here's the valid json:
[code]
{
"sEcho":1,
"iTotalRecords":1,
"iTotalDisplayRecords":1,
"aaData":[
["TAA","Create ProgramTAA","ActiveTAA","Waiting OnTAA","OwnerTAA","When CreatedTAA","When StartedTAA","When EndedTAA","Next DeliveryTAA","InstructionsTAA"]
]
}
[/code]
And I'm implementing it like so:
[code]
$('#viewTableTest').dataTable({
"iDisplayLength": 25,
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
"bStateSave": true,
"bServerSide": true,
"sAjaxSource": "../tasks/manage.jsp?_response=true&_action=filterTasks"
});
[/code]
Any ideas?
I'm getting the "json data from server failed to load or be parsed" message. I'm returning this data from a Java Servlet. My content type is defined as "application/json" and I also tried x-json.
Here's the valid json:
[code]
{
"sEcho":1,
"iTotalRecords":1,
"iTotalDisplayRecords":1,
"aaData":[
["TAA","Create ProgramTAA","ActiveTAA","Waiting OnTAA","OwnerTAA","When CreatedTAA","When StartedTAA","When EndedTAA","Next DeliveryTAA","InstructionsTAA"]
]
}
[/code]
And I'm implementing it like so:
[code]
$('#viewTableTest').dataTable({
"iDisplayLength": 25,
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
"bStateSave": true,
"bServerSide": true,
"sAjaxSource": "../tasks/manage.jsp?_response=true&_action=filterTasks"
});
[/code]
Any ideas?
This discussion has been closed.
Replies
Allan
Good to hear you got it sorted.
Allan