if you have the button
<button id="up_btn">Upload</button>
You can try with
$('#fileupload').fileupload({
dataType: 'json',
add: function (e, data) {
$("#up_btn").off('click').on('click', function () {
data.submit();
});
},
});
EDIT: according to comments a better answer considere off
to avoid duplicated requests. (also work unbind
, I do not check if is bind
and unbind
but jquery team recommend on
and off
link since 1.7)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…