mercredi 15 avril 2020

In Laravel + Turbolinks, $ is not a function (jQuery not recognize)

I am using Turbolinks which is really awesome in laravel.

I installed turbolinks using npm and build turbolinks.js. (Not any other jQuery, Popper.js.., only turbolinks.js).

And i included it.

<head>
    <script defer src=""></script>
</head>


<script src="" type="text/javascript" data-turbolinks-track="true"></script>
<script type="text/javascript">
 $(document).on('turbolinks:load',function() {
      //instead of $(document).read(function(){});
    });
</script>

vendors.bundle.js includes jquery, bootstrap, popper.js.

When I load project, turbolinks worked perfectly but only issue is this.

Uncaught TypeError: $ is not a function

Including $("#test").modal(); All jquery functions didn't work.

Can anyone help me?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire