DataTables suddenly stopped working today

DataTables suddenly stopped working today

lennyhadleylennyhadley Posts: 30Questions: 8Answers: 0

Suddenly all the data tables all over my site don't load now.

https://www.topflightfantasysports.com/nba/nba-matchups-nba-starting-lineups/

That's an example, all pages look like that now.

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    The first error I see is this in the browser's console:

    maxmegamenu.js?ver=2.5.2:516 Uncaught ReferenceError: jQuery is not defined

    Looks like you are loading jQuery multiple times:

    Line 114:
    <script type='text/javascript' src='https://www.topflightfantasysports.com/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>

    Line 3030:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

    Line 3032:
    <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js""></script>

    You only want to load it once and before the other JS include files that require it.

    I think I saw you are loading /jquery/ui/core.min.js a couple times too. In general you only want to load CSS and JS include files once.

    There are a couple other errors in the console but those should be cleaned up once you load jquery.js once.

    Kevin

This discussion has been closed.