Server-Side Processing fails to display in FireFox
Server-Side Processing fails to display in FireFox
I'm new to DataTables, and am having difficulty getting DataTables to display valid JSON data in Firefox when using server-side processing.
In IE, the following works just fine:
JavaScript: [code]
$(document).ready(function() {
$('#entries').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "server_processing.php"
} );
} );
[/code]
And my PHP:[code]
$aJSON = array();
$aJSON["sEcho"] = intval($_GET['sEcho']);
$aJSON["iTotalRecords"]=1;
$aJSON["iTotalDisplayRecords"]=1;
$aJSON["aaData"]=array(array("one","two","three","four","five"));
echo json_encode($aJSON);[/code]
However, in Firefox, I get the "JSON data from server failed to load or be parsed" alert box, then only "Loading data from server" is displayed along with the "Processing ... " div. Also, if I switch from a GET request to a POST request, the initial alert box doesn't display in Firefox, but nothing else changes in either browser.
I have confirmed using JSONlint that my JSON object that is being returned is valid:
{"sEcho":1,"iTotalRecords":1,"iTotalDisplayRecords":1,"aaData":[["one","two","three","four","five"]]}
Thanks for any help!
In IE, the following works just fine:
JavaScript: [code]
$(document).ready(function() {
$('#entries').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "server_processing.php"
} );
} );
[/code]
And my PHP:[code]
$aJSON = array();
$aJSON["sEcho"] = intval($_GET['sEcho']);
$aJSON["iTotalRecords"]=1;
$aJSON["iTotalDisplayRecords"]=1;
$aJSON["aaData"]=array(array("one","two","three","four","five"));
echo json_encode($aJSON);[/code]
However, in Firefox, I get the "JSON data from server failed to load or be parsed" alert box, then only "Loading data from server" is displayed along with the "Processing ... " div. Also, if I switch from a GET request to a POST request, the initial alert box doesn't display in Firefox, but nothing else changes in either browser.
I have confirmed using JSONlint that my JSON object that is being returned is valid:
{"sEcho":1,"iTotalRecords":1,"iTotalDisplayRecords":1,"aaData":[["one","two","three","four","five"]]}
Thanks for any help!
This discussion has been closed.
Replies