custom event javascriptjquery code example
Example 1: jquery trigger change event
$(selector).trigger("change");
Example 2: trigger send parameter
$('body').trigger('this_works', [{data: [1, 2, 3]}, 'something']);
$('body').on('this_works', function (event, json, string) {
// parameter is stocked in json.data here.
console.log(event, json, string);
});