diff --git a/entries/trigger.xml b/entries/trigger.xml index c840b058..91e3c26a 100644 --- a/entries/trigger.xml +++ b/entries/trigger.xml @@ -46,6 +46,7 @@ $( "#foo").trigger( "custom", [ "Custom", "Event" ] );
The .trigger()
method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound to the object will be called when the event is triggered.
window
, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault()
. If this behavior is not desired, use .triggerHandler()
instead..triggerHandler()
, when calling .trigger()
with an event name matches the name of a property on the object, prefixed by on
(e.g. triggering click
on window
that has a non null onclick
method), jQuery will attempt to invoke that property as a method.length
property, you should pass the object in an array (e.g. [ { length: 1 } ]
).