DataTables do not load AJAX data on MacOS?

DataTables do not load AJAX data on MacOS? Posts: 2Questions: 1Answers: 0
edited November 2023 in Free community support

No Console errors, no errors in DataTables debugger.
Am I missing something?

<!DOCTYPE html><html lang="en">
        <title>JavaScript example</title>
        <meta charSet="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <link rel="stylesheet" href=""/>
        <script src=""></script>
        <script src=""></script>

    new DataTable('#example', {
        "ajaxSource": 'data/objects_deep.txt',
    columns: [
        { data: 'name' },
        { data: 'hr.position' },
        { data: 'contact.0' },
        { data: 'contact.1' },
        { data: 'hr.start_date' },
        { data: 'hr.salary' }
    processing: true
<table id="example" class="display" style="width:100%">
            <th>Start date</th>
            <th>Start date</th>


Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide


  • kthorngrenkthorngren Posts: 19,922Questions: 26Answers: 4,696

    There isn't anything obvious in your code snippet. You are using the legacy (ajaxSource) form of the ajax option. See the 1.9 to 1.10 conversion guide for more info. I don't thnk changing to ajax will make a difference.

    Make sure your webserver can can resolve the path to data/objects_deep.txt.

    Use the browser's network inspector tool to see the XHR request and response. Let us know what you find. Can you post a link to your page or a test case repliacting the issue so we can help debug?


  • Posts: 2Questions: 1Answers: 0

    Well, this is embracing...
    I forgot that the code needs to run inside of
    $(document).ready(function(){ /code here/ })
    And then there is a CORS block

  • allanallan Posts: 61,022Questions: 1Answers: 9,951 Site admin

    The other option is to stick the script for the loading of the table at the end of the body. Good to hear you got that fixed though. The CORS issue would require a change to the headers sent by the server.


Sign In or Register to comment.