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

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -