$ is not a function - jQuery error

前端 未结 10 1195
余生分开走
余生分开走 2020-11-29 20:41

I have the jQuery loaded fine, I\'ve quadruple-checked, though I\'m getting this error in FireBug \"$ is not a function\" and my code doesn\'t work.

Here\'s my code:

10条回答
  •  没有蜡笔的小新
    2020-11-29 21:09

    It's really hard to tell, but one of the 9001 ads on the page may be clobbering the $ object.

    jQuery provides the global jQuery object (which is present on your page). You can do the following to "get" $ back:

    jQuery(document).ready(function ($) {
        // Your code here
    });
    

    If you think you're having jQuery problems, please use the debug (non-production) versions of the library.

    Also, it's probably not best to be editing a live site like that ...

提交回复
热议问题