You can bind the same handler to multiple events. It sounds like you
are trying to "fake click" the button right after load to initialize
things. I do that a lot.

$(document).ready(function(){

  $('#mybtn').bind('click init', function(e){
    alert("called because of "+e.type);
  }).trigger("init");

});

You could also use .triggerHandler("click") instead, but I prefer to
make it clear the call is because of initialization.

Reply via email to