在过去的 3 个小时里,我一直在尝试调试这个问题,现在拉扯我的头发。在我的网站中,当我加载时,我得到一个未定义的不是函数。我一直在查看语法,似乎没有任何问题。这是我网站的链接。如果您检查控制台,那么它会在第一次加载时出错。任何想法?
问问题
612 次
1 回答
5
Your plugin "Lazy Load" does not terminate with a semi colon, and as such cannot be combined into a single file with "malihu jquery custom scrollbars".
As the second plugin starts with (
, the javascript engine will interpret that as a call to a function that it expects to be returned from the previous function call.
Add a ;
at the end of the Lazy Load file.
Roughly, the code
/*
* Lazy Load - jQuery plugin for lazy loading images
*/
(function(a,b,c,d){ .... })(jQuery,window,document)
/*
== malihu jquery custom scrollbars plugin ==
*/
(function($){ ...})(jQuery);
is interpreted as
anonymousFunction(jQuery, window, document)(function($) { ... })
^ anonymous function returns undefined
but a function was expected
于 2013-05-02T06:55:35.660 回答