JavaScript/jQuery - “$ is not defined- $function()” error

后端 未结 8 2050
轻奢々
轻奢々 2020-11-30 08:15

I am trying to run a JavaScript/jQuery function and Firebug gets the error:

$ is not defined $(function()\".

The JavaScript code is placed

8条回答
  •  时光说笑
    2020-11-30 09:11

    I have solved it as follow.

    import $ from 'jquery';
    
    (function () {
        // ... code let script = $(..)
    })();
    

提交回复
热议问题