For example, I am using jQuery validation plugin which provides a way to set the default settings using jQuery.validator.setDefaults()
. I would like these settings and other things to be used for my entire application.
$(document).on('mobileinit', function(){
jQuery.ajaxSetup({ ... });
$.fn.pluginName = function() { ... };
jQuery.validator.setDefaults({ ... });
jQuery.validator.addMethod(...);
});
$(document).on('pagecreate', '#register', function(){ ... });
$(document).on('pagecreate', '#login', function(){ ... });