Tabler: jquery $ selector not work

Created on 21 Apr 2018  路  5Comments  路  Source: tabler/tabler

hi
i write a simple script to select parent nav-item of a dropdown-item and set it active

$('.active').parent().parent().children(".nav-link").addClass("active");

but get this error

Uncaught ReferenceError: $ is not defined

Most helpful comment

Did you put your code in require block? Just like this:

require(['c3', 'jquery'], function (c3, $) {
    $(document).ready(function() {
        // Your code goes here
    });
});

All 5 comments

You seem not to have loaded first the Jquery library. Make sure you included it before the call.

@ChriStef require.js is included on the head, i use blank page of tabler demo

Did you put your code in require block? Just like this:

require(['c3', 'jquery'], function (c3, $) {
    $(document).ready(function() {
        // Your code goes here
    });
});

@tdtgit no, thank u

Hope your problem solved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KiarashS picture KiarashS  路  6Comments

masihfathi picture masihfathi  路  3Comments

ghost picture ghost  路  4Comments

saileshkush95 picture saileshkush95  路  4Comments

hamada147 picture hamada147  路  4Comments