DataTables 1.10.2 Having Troubles loading jquery.dataTables.css from Directory.

DataTables 1.10.2 Having Troubles loading jquery.dataTables.css from Directory.

cyclingtoncyclington Posts: 2Questions: 1Answers: 0

New Datatables user here, i have just uploaded the Datatables directory onto my server, they are in the /var/www directory of my website. However the CSS formatting is not working on the html table, directly.

I tried the Datatables debugger, it brings the following error: "DataTables debug bookmarlet: jQuery not loaded on this page, therefore no DataTables :-("

However as far as i can see the javascript is properly declared in my script, but to no avail:

<html>
<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css" href="/DataTables-1.10.2/media/css/jquery.dataTables.css">

<!-- jQuery -->
<script type="text/javascript" charset="utf8" src="/DataTables-1.10.2/media/js/jquery.js"></script>

<!-- DataTables -->
<script type="text/javascript" charset="utf8" src="/DataTables-1.10.2/media/js/jquery.dataTables.js"></script>
<body>
    <script>
        $(document).ready(function() {
            $('#table_id').DataTable({
                "lengthMenu": [[10, 25, 50, - 1], [10, 25, 50, "All"]], 
                "iDisplayLength": -1
            });
        });
    </script>
    <table id="table_id" class="display">
        <thead>
            <tr>
                <th>ART NO.</th>
                <th>ARTIKELNAME</th>
                <th>EAN</th>
                <th>SHOP 5</a></th>
                <th>LETZTE UPDATE</th>
            </tr>
        </thead>

.....

linking directly to a CDN brings a formatted table result back, any ideas what i am doing wrong?

Thanks in advance!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    Answer ✓

    Your HTML looks invalid. There is no head or body tag.

    Allan

  • cyclingtoncyclington Posts: 2Questions: 1Answers: 0

    I cut half of the script off as there is a php function running inside the html tags that produces the html table output.

    When using the CDN links the site is properly rendered, but when i use the locally installed files, the html doesnt render with the DataTables CSS formatting. I debugged the working version, the fdebug file number is oraqur - its only when i use the locally installed files that the html doesnt render at all.

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin

    I'd probably need to be able be able to see the page in order to be able to understand what is going wrong. Can you give me a link? Are there any errors reported in the console in your browser?

    Allan

This discussion has been closed.