>HI, >i have these line on document.ready and using jquery-1.1.3.pack.js >(no, not 1.1.3.1): > >$(function(){ > $('#chiamacap').trigger('click'); > > > $("a#chiamacap").bind("click", >function(){ > alert("hi"); > }); >}); > > >The book says that you can simulate a click by using the trigger() >method. >If i click the #chiamacap link it runs an alert. wow ;-) >But by applying trigger() to $('#chiamacap') on load does not work. >What am i doing wrong?
You're triggering the click action before binding the click behavior. You need to bind the behavior before you can trigger it. -Dan