Pass Data using jQuery Trigger Event to a Change Eveng Handler

Waktu men-trigger event change untuk html element tertentu, kita dapat mem-pass data. Contoh kode sbb

[code language=”javascript”]
$(‘.change_main_image’).on(‘click’, function() {
$(‘input[name=photo].change_uploader’).trigger(‘change’, [{somedata:true}]);
});

$(‘input[name=photo].change_uploader’).on(‘change’, function (e, data) {
alert(data.somedata);
//canvas resize and upload script
});
[/code]

http://stackoverflow.com/questions/13506209/pass-data-using-jquery-trigger-event-to-a-change-event-handler

Chandra Oemaryadi has written 244 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>