You know what, I just think I fixed my own problem. The function call
is executed before I bind the click event to the button, which means
that it has no event to trigger yet. Two days I've spent wondering
about this, and only saw it because of far, far fewer lines of code on
that example page.

Thanks!
T.J.

On Dec 9, 8:56 am, "T.J." <theimmortal...@gmail.com> wrote:
> Thanks for the link; I haven't heard of that site before.
>
> http://jsbin.com/axuwi3is my (very basic) example of what I'm trying
> to attempt. What the button on my page actually does is quite
> different, and if you need that then let me know.
>
> On Dec 9, 8:29 am, "Richard D. Worth" <rdwo...@gmail.com> wrote:
>
>
>
> > Could you share a live sample page? If you don't have a place to host one,
> > jsbin.com:
>
> >http://jsbin.com/
>
> > That will allows us to see what you're seeing quite easily.
>
> > - Richard
>
> > On Wed, Dec 9, 2009 at 9:23 AM, T.J. <theimmortal...@gmail.com> wrote:
> > > For further clarification, the way I'm calling that is as follows:
>
> > > for (var x = 1; x <= count; x++) {
> > >     $("#button").triggerHandler("click");
> > > }
>
> > > which is inside of a function that I call on page load, and it isn't
> > > working at all.
>
> > > Thanks,
> > > T.J.
>
> > > On Dec 8, 1:32 pm, "T.J." <theimmortal...@gmail.com> wrote:
> > > > Hi all,
>
> > > > I have a click event bound to a button that I'm needing to call
> > > > without any user interaction on the button. I'm using the fragment
> > > > portion of the URL to determine how many times the button's "click"
> > > > function needs to fire and using a for loop to (attempt to, at least)
> > > > trigger the click. I've tried this with .click(), .trigger("click"),
> > > > and .triggerHandler("click") but with no success. I could write a
> > > > JavaScript function and call that within the loop, but that's
> > > > unnecessary code..
>
> > > > Is what I'm doing valid, or can the .trigger/.triggerHandler methods
> > > > not be called from within a loop? The syntax I'm using is as follows:
>
> > > > $("#button").triggerHandler("click");
>
> > > > Thanks,
> > > > T.J.

Reply via email to