DataTables 1.10.4 nodeName/elem is null, bugs?

DataTables 1.10.4 nodeName/elem is null, bugs?

warheat1990warheat1990 Posts: 4Questions: 2Answers: 0
edited December 2014 in Free community support

So I have a html page with html table and this script

<script>
    $(document).ready(function () {
        $('table').DataTable();
    })
</script>

It is working fine when I tried to change the total entries shown or search, but the console give me an error 'Cannot read property 'nodeName' of null' on Chrome or 'elem is null' on firefox. I'm using jquery 1.11.1 and this is the culprit (jquery-1.11.1.js:3618) :

jQuery.acceptData = function( elem ) {
    var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
        nodeType = +elem.nodeType || 1;

    // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
    return nodeType !== 1 && nodeType !== 9 ?
        false :

        // Nodes accept data unless otherwise specified; rejection can be conditional
        !noData || noData !== true && elem.getAttribute("classid") === noData;
};

The error is thrown because elem is null, I'm a beginner in js so anyone know if this is jquery fault or datatables bug?

Any help will be appreciated

Answers

  • allanallan Posts: 61,890Questions: 1Answers: 10,143 Site admin

    Can you link to a test page showing the problem, as required in the forum rules.

    Thanks,
    Allan

  • warheat1990warheat1990 Posts: 4Questions: 2Answers: 0

    I figured it out, it was caused by $('#backend').validate().settings.ignore = []; in my Layout page.

This discussion has been closed.