jeudi 17 juin 2021

Console not finding the function even if it was included/imported - Javascript / Laravel

I'm currently working on an old project work which utilizes a function for the dropdown design of the web application running in PHP/Laravel.

It shows me this error on the console:

app.js:121 Uncaught TypeError: $(...).dcDrilldown is not a function
at HTMLDocument.<anonymous> (app.js:121)
at j (jquery.min.js:2)

But when I checked my app.blade.php under resources/views, it is importing the file that contains that specific function:

<script type="text/javascript" src=""></script>

Inside the drilldown.js, the function dcDrilldown is found:

(function($){
//define the new for the plugin ans how to call it
    console.log("Here I am with open arms~");
    $.fn.dcDrilldown = function(options) {
        console.log("Now I come to you~");

On the console logs, the logs "Here I am with open arms~" is being shown but not the console inside the function: Click here for image

Any ideas why the dcDrilldown function is not being found? Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire