Uncaught TypeError: undefined is not a function on loading jquery-min.js

前端 未结 13 794
北荒
北荒 2020-11-28 22:55

I\'m building a normal webpage which requires me to load about five CSS files and ten Javascript files.

  • When loading them separately in the HTML page, my webpa
13条回答
  •  悲&欢浪女
    2020-11-28 23:34

    This solution worked for me

    
        ;(function($){
            // your code
        })(jQuery);
    
    

    Move your code inside the closure and use $ instead of jQuery

    I found the above solution in https://magento.stackexchange.com/questions/33348/uncaught-typeerror-undefined-is-not-a-function-when-using-a-jquery-plugin-in-ma

    after seraching too much

提交回复
热议问题