datatable loads with jquery 1.3.2 but not 1.4.2

datatable loads with jquery 1.3.2 but not 1.4.2

d3vilr3dd3vilr3d Posts: 8Questions: 0Answers: 0
edited April 2010 in General
Hi guys,

My sample datatable runs loads fine with jquery 1.3.2 but if I switch to 1.4.2 it doesn't load (stuck showing 'Processing...'). Any reason why this happens? Im using a simple json server_processing data source.

[code]
$(document).ready(function() {
$('#datatable').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "admin/server_processing.php"
});
});
[/code]

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Most likely your json isn't strictly valid. jQuery 1.4 was a lot more strict about enforcing the rules (rather than just doing 'eval()'!). Run your json returned through this: http://www.jsonlint.com/

    Allan
  • d3vilr3dd3vilr3d Posts: 8Questions: 0Answers: 0
    hmm, I switched to the sample server_processing.php and still same problem. firebug shows the data return, it's just not populating in the table.
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Did you run the returned data through jsonlint.com? Can you post a link to your page which is showing this?

    Allan
  • d3vilr3dd3vilr3d Posts: 8Questions: 0Answers: 0
    Thanks for the pointer allan. I fixed json format and the result shows up fine now. cheers
  • LoboLobo Posts: 9Questions: 0Answers: 0
    This clue solve too my pb in http://datatables.net/forums/comments.php?DiscussionID=1424.
    thanks.
  • therancortherancor Posts: 1Questions: 0Answers: 0
    I am having this problem also. My JSON validates, but datatables just says "processing". I removed all addslashes() from the php, but I'm still having an issue. I am using the sample server_processing.php file with edits to pull my database info. If anybody has any ideas, I would appreciate the help.
  • LoboLobo Posts: 9Questions: 0Answers: 0
    If in the json there is some elements with value 'null', this behaviour appears especially if you use the json_encode php function.
This discussion has been closed.