Hello all,

I cannot for the life of me figure out the syntax given in the subject
line.

Through all of the following, I am referring to the examples tab of
the following page: http://docs.jquery.com/Events/trigger

I've got a 'live' event, waiting for a custom trigger.

I pull the trigger, fire the event, and all goes well.

However, using the following trigger syntax, data pass-through does
not perform at all as expected:

myJQueryObject.trigger('myEvent', [value1, value2]);

My event gets triggered, however all passed values are totally
ignored, so far as I can tell.  It seems to me that my live event's
arguments are always firstly the event, and then my live event's
selector (which is an attribute selector).  The desired passed
information does not seem to dwell in the event object, either.

As far as I can tell after about an hour of tear-jerking tests, this
is undocumented behavior.  Furthermore, the only syntax I can coerce
to properly function is to do the following:

myJQueryObject.trigger('myEvent', {
  type : 'myEvent',
  var1 : value1,
  var2 : value2
});

This however makes the values attributes of the 'event' object.
Workable, but I must ask the age-old linux question: Why does the
documentation lie to us?  I'd much prefer that either the original
array-based syntax work as advertised, or someone alter that examples
tab to clarify what is supposed to happen there.

Thanks in advance, wonderful people.

Reply via email to