I have created a custom jQuery function in my web application and it is working fine without master pages, now I have a master page and i have added a reference to my .js file on the Content page and call the custom js method then it gives me error like
Type error: object function (selector, context){ //the jquery object is actually just the constructor 'enhanced' return new jQuery.fn.init(selector, context, rootjQuery); }has no method 'myCustomMethod'
i am calling the custom method like:
$(document).ready(function () {
$('#btnTest').click(function () {
try {
$.myCustomMethod();
} catch (e) {
alert(e);
}
});
});
my js code is
(function ($) {
$.fn.myCustomMethod = function () {
// all my code here
}; })(jQuery);
any help would be greatly appreciated.