Understanding the reason for error in this jQuery setup...
I see a lot of developers use the following technique because it guarantees that $ is being used for jQuery, when the window is ready...
- (function($){
- $(window).load(function(){
- myFunction();
- })
- })(jQuery);
But why does the code below, generate an error in my console window?...
- (function($){
- $(window).load(function(){
- $.myFunction();
- })
- })(jQuery);
Line 4 is just a jQuery function, as upose to a function declaration I used above. Why is that reason enough to generate an error in my console window?
Thanks for helping me understand.
blackhawk
*Break through the ice and never look back*