Skip to content

Instantly share code, notes, and snippets.

@tqyq
Last active November 30, 2015 02:30
Show Gist options
  • Save tqyq/0175bfd7e0115a05ab8f to your computer and use it in GitHub Desktop.
Save tqyq/0175bfd7e0115a05ab8f to your computer and use it in GitHub Desktop.
ajaxupload using ajaxupload.js
$(function() {
new AjaxUpload("up_btn", {
action: "/home/api/upload",
autoSubmit: true,
name: "bin",
data: {},
responseType: 'json',
onChange: function (file, extension) {
},
onSubmit: function (file, extension) {
$.messager.progress();
},
onComplete: function (file, data) {
$("#url").textbox('setValue', data.bin.url);
$.messager.progress('close');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment