JQuery Error: Uncaught TypeError: Object # has no method 'ready'

前端 未结 3 964
广开言路
广开言路 2020-12-15 16:15

my site is getting the error in this title in the javascript console. Google seems to say that it is because jquery isn\'t loaded, but it is definitely visible in the head

3条回答
  •  别那么骄傲
    2020-12-15 16:39

    Yup - I believe that's exactly the problem. jQuery and mooTools fight over the use of the $ notation.

    You're on the right track with using

    try{
       jQuery.noConflict();
     } catch(e){};
    

    But after you use that, in order to use jQuery functionality, you have to call it jQuery(...) instead of $(...). Example:

    // Use jQuery via jQuery(...)
     jQuery(document).ready(function(){
       jQuery("div").hide();
     });
    

    Here's a link to the jQuery docs regarding this: http://docs.jquery.com/Using_jQuery_with_Other_Libraries

提交回复
热议问题