jQuery issue - # has no method

后端 未结 6 1997
长发绾君心
长发绾君心 2020-12-17 07:35

I\'ve tried a veriety of jQuery plugins recently and I keep getting this error …


(source: shaunbellis.co.uk)

… regardless of what plugin I

6条回答
  •  星月不相逢
    2020-12-17 08:27

    This usually has to do with a selector not being used properly. Check and make sure that you are using the jQuery selectors like intended. For example I had this problem when creating a click method:

    $("[editButton]").click(function () {
        this.css("color", "red");
    });
    

    Because I was not using the correct selector method $(this) for jQuery it gave me the same error.

    So simply enough, check your selectors!

提交回复
热议问题