0

I have been trying to debug this issue for the past 3 hours and pulling my hair now. In my site when I load I get a undefined is not a function. I've been looking at the syntax and nothing seems to be wrong. Here is a link to my site. If you check the console, then it errors on the first load. Any idea?

1 Answer 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
Sign up to request clarification or add additional context in comments.

2 Comments

this is weird.. I added a ; at the end of the lazy load file, but it didn't help..
@adit: A browser cache issue perhaps? I no longer see the errors when visiting the site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.