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

后端 未结 8 1413
南笙
南笙 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:41

    Remember that you must first load jquery script and then the script js

    <script type="text/javascript" src="http://code.jquery.com/jquery-2.2.4.min.js"></script>
    <script type="text/javascript" src="example.js"></script>
    

    Html is read sequentially!

    0 讨论(0)
  • 2021-02-07 00:44

    many other people answered your question above. This problen arises when your script don't find the jQuery script and if you are using other framework or cms then maybe there is a conflict between jQuery and other libraries. In my case i used as following- `

    <script src="js_directory/jquery.1.7.min.js"></script>
        <script>
        jQuery.noConflict();
        jQuery(document).ready(
        function($){
        //your other code here
        });</script>
    

    `

    here might be some syntax error. Please forgive me because i'm writing from my cell phone. Thanks

    0 讨论(0)
提交回复
热议问题