javascript - What does this JS Syntax do? -


why put brackets around true here.... doesn't make array? else?

$e.trigger("onlyshowifchange", [true]); 

.trigger( eventtype, extraparameters )

eventtype: string containing javascript event type, such click or submit.

extraparameters: array of additional parameters pass along event handler.

the second parameter has array

$e.trigger("onlyshowifchange", [true, false]);  $e.bind("onlyshowifchange", function(ev, truebool, falsebool) {    ... }); 

this means if want pass parameters event binding functions have pass in array of parameters trigger second argument.


Comments

Popular posts from this blog

c++ - error: use of deleted function -

delphi - ESC/P programming! -

c# - how to write client side events functions for the combobox items -