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

后端 未结 8 2051
轻奢々
轻奢々 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:02

    You must not have made jQuery available to your script.

    Add this to the top of your file:

    
    

    This issue is related to the jQuery/JavaScript file not added to the PHP/JSP/ASP file properly. This goes out and gets the jQuery code from the source. You could download that and reference it locally on the server which would be faster.

    Or either one can directly link it to jQuery or GoogleCDN or MicrosoftCDN.

    How do add jQuery to your webpage

提交回复
热议问题