Direct trigger jquery function
Hi,
I need some help on how to direct call/trigger my jquery function. I'm still new in JQuery.
Function:
- (function ( $ ) {
$.fn.ajaxcall = function( options ) {
var opts = $.extend( {}, $.fn.ajaxcall.defaults, options );
this.click(function(){
/* DO SOMETHING HERE.... */
}); /* onclick */
}
$.fn.ajaxcall.defaults = {
/* SOME DEFAULT VARs*/
};
}( jQuery ));
My normal function trigger/call
- $('.ajaxclick').ajaxcall({id:'#id1'});
Inside ajaxcall, it will check for 'click' and do some processing.
In certain situation, I would like to trigger it directly/on page load (direct trigger click) if I explained this correctly. I do not know how to call my ajaxcall in this situation.
Any help are very much appreciated. Thanks.