So I got this code
$(document).ready(function(){
$.fn.loadView = function(a){
};
$('#id').click(function(){
$.fn.loadView();
});
$.fn.loadView();
});
So when the code loads up the initialized $.fn.loadView() just fine the first time. But then when $('#id').click is activated I get this error
$.fn.loadView is not a function
Whats really making me mad is that I just got done doing something exactly like this on another project and it worked just fine.
Make sure that you’re not including jQuery twice in the page, this is the most common cause of plugin functions being undefined later. Since a later include replaces the
jQuery/$object, all methods defined on it are lost.