$ is not a function

后端 未结 4 388
暗喜
暗喜 2021-01-24 22:11



        
相关标签:
4条回答
  • 2021-01-24 22:48

    Have you referenced jQuery as the first script in your page? Does the path exist? Try using Google's, just to test:

    <script type="text/javascript" 
            src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js">
    </script>
    
    0 讨论(0)
  • 2021-01-24 22:48

    It seems that jQuery is conflicting with any existing javascript library.

    I hope this link might help.

    0 讨论(0)
  • 2021-01-24 22:53

    jQuery may be conflicting with another definition, the fact that you can use it in the ready function seems to indicate that it is at least loaded. Have you tried using:

    <script type="text/javascript" src="framework/resources/jquery-1.5.1.js"></script>
    <script type="text/javascript">
          var blink = function() {
                jQuery('#blink').toggle();
           };
    </script>
    

    Sometimes it is cleaner to go direct to the object. If you find that resolves your problem you may wish to switch to noConflict mode which is described in more detail in the docs here:

    http://api.jquery.com/jQuery.noConflict/

    Hope that helps.

    0 讨论(0)
  • 2021-01-24 23:11

    That error means jquery isn't loaded

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