$(document).ready(function(){ Uncaught ReferenceError: $ is not defined

后端 未结 8 1482
南笙
南笙 2021-02-06 23:43

Hi I am having a \"Uncaught ReferenceError: $ is not defined\" while using bellow codes

I am currently getting the following error in my log. I have been looking at the

8条回答
  •  天涯浪人
    2021-02-07 00:40

    $ is a function provided by the jQuery library, it won't be available unless you have loaded the jQuery library.

    You need to add jQuery (typically with a

    Make sure you load jQuery before you run any script which depends on it.

    The jQuery homepage will have a link to download the current version of the library (at the time of writing it is 3.5.1 but that may change by the time you read this).

    Further down the page you will find a section on using jQuery with a CDN which links to a number of places that will host the library for you.


    (NB: Some other libraries provide a $ function, and browsers have native $ variables which are only available in the Developer Tools Console, but this question isn't about those).

提交回复
热议问题