|
Events
Table of ContentsExamplepq('form')->bind('submit', 'submitHandler')->trigger('submit')->...
function submitHandler($e) {
print 'Target: '.$e->target->tagName;
print 'Bubbling ? '.$e->currentTarget->tagName;
}Server Side EventsphpQuery support server-side events, same as jQuery handle client-side ones. On server there isn't, of course, events such as mouseover (but they can be triggered). By default, phpQuery automatically fires up only change event for form elements. If you load WebBrowser plugin, submit and click will be handled properly - eg submitting form with inputs' data to action URL via new Ajax request. $this (this in JS) context for handler scope isn't available. You have to use one of following manually:
Page Loadnone Event Handling
Interaction Helpersnone Event Helpers
Read more at Events section on jQuery Documentation Site. |
► Sign in to add a comment