Can't load json object, always showing "loading"

Can't load json object, always showing "loading"

SummerJ1745SummerJ1745 Posts: 9Questions: 3Answers: 0

Hi, All,
I used example on the dataTable page

http://live.datatables.net/lomapoke/1/edit

however, it always showed "loading" and no data was loaded.

here is the code


<!DOCTYPE html> <html> <head> <link rel='stylesheet' href='https://cdn.datatables.net/1.10.9/css/jquery.dataTables.min.css'> <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> <script src='https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js'></script> <script type="text/javascript" src="https://www.datatables.net/media/js/site.js?_=9831ea28f2ee98e525c11ef017a71afa"></script> <script type="text/javascript" src="https://www.datatables.net/media/js/dynamic.php?comments-page=examples%2Fdata_sources%2Fajax.html" async=""></script> <script type="text/javascript" src="https://www.datatables.net/examples/resources/demo.js" async=""></script> <meta charset=utf-8 /> <title>DataTables - JS Bin</title> <style type="text/css" class="init"> body { font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif; margin: 0; padding: 0; color: #333; background-color: #fff; } div.container { min-width: 980px; margin: 0 auto; } div.dataTables_processing { z-index: 1; } </style> <script type="text/javascript" class="init"> $(document).ready( function () { alert('doc ready'); var table = $('#example').DataTable( { ajax: 'http://live.datatables.net/ajax/arrays.txt', processing: true } ); $('#reload').click( function () { table.ajax.reload(); } ); } ); </script> </head> <body> <button id="reload">Reload</button> <div class="container"> <table id="example" class="display" width="100%"> <thead> <tr> <th>Name</th> <th>Position</th> <th>Office</th> <th>Age</th> <th>Start date</th> <th>Salary</th> </tr> </thead> <tfoot> <tr> <th>Name</th> <th>Position</th> <th>Office</th> <th>Age</th> <th>Start date</th> <th>Salary</th> </tr> </tfoot> </table> </div> </body> </html>

Answers

  • crambldacramblda Posts: 15Questions: 2Answers: 1

    Your example is working for me. Maybe a temporary system issue that has been resolved?

  • SummerJ1745SummerJ1745 Posts: 9Questions: 3Answers: 0

    I tried on different browser just now, didn't work.

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    edited September 2015

    I tried on different browser just now, didn't work.

    What browser(s) have you tried? Your example works for me (Firefox).

    I used example on the dataTable page

    What example, what page?

  • SummerJ1745SummerJ1745 Posts: 9Questions: 3Answers: 0

    I tried both Firefox and chrome. The example age
    http://live.datatables.net/lomapoke/1/edit works for me. But if I copy the source code and put everything in the html above, it didn't work.

  • KimvdLindeKimvdLinde Posts: 30Questions: 8Answers: 0

    There is a problem in 1.10.9 datatables with row identification that might affect your problem. Download the nightly build at the download page to see if that is the issue. It solved my issue.

  • SummerJ1745SummerJ1745 Posts: 9Questions: 3Answers: 0

    The latest download was Sept 1st, I tried both today and last night, not working either.

  • SummerJ1745SummerJ1745 Posts: 9Questions: 3Answers: 0

    Event the downloaded example from DataTable 1.10.9. The example code provided was not working. not data got loaded into the table. DataTables-1.10.9/examples/data_sources/ajax.html

  • MikeSMikeS Posts: 113Questions: 1Answers: 0

    "But if I copy the source code and put everything in the html above, it didn't work."

    Are you aware that the jQuery core changed for version 2.0.3 (I think) that prevented IE from reading local files? See https://forum.jquery.com/topic/jquery-2-0-3-and-ajax-local-files for details.

  • SummerJ1745SummerJ1745 Posts: 9Questions: 3Answers: 0

    I was using jquery 1.11.3 and didn't use IE.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    The example appears to work correctly for me as well - Chrome Mac.

    If your local copy isn't working I would suggest taking a look at your browser's console to see if any errors are reported.

    Allan

This discussion has been closed.