$ is not a function - jQuery error

前端 未结 10 1191
余生分开走
余生分开走 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 20:55

    There are two possible reasons for that error:

    1. your jquery script file referencing is not valid
    2. try to put your jquery code in document.ready, like this:

      $(document).ready(function(){

      ....your code....

      });

    cheers

提交回复
热议问题