jQuery issue - # has no method

后端 未结 6 1988
长发绾君心
长发绾君心 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:20

    For anyone else arriving at this question:

    I was performing the most simple jQuery, trying to hide an element:

    ('#fileselection').hide();
    

    and I was getting the same type of error, "Uncaught TypeError: Object #fileselection has no method 'hide'

    Of course, now it is obvious, but I just left off the jQuery indicator '$'. The code should have been:

    $('#fileselection').hide();
    

    This fixes the no-brainer problem. I hope this helps someone save a few minutes debugging!

提交回复
热议问题