我在jQuery中使用AjaxUpload插件,並且大部分工作都正常,但我必須點擊兩次按鈕才能執行它。我猜這是一個範圍的問題......或者還在學習......jQuery AjaxUpload,必須點擊按鈕兩次?
這裏是我的代碼(?):
$(".upload-button").live("click", function(event) {
event.preventDefault();
var currentId = $(this).closest("div").attr("id").replace("slide-", "");
new AjaxUpload($(this), {
action: "./php/upload.php",
name: 'userfile',
autoSubmit: true,
onSubmit: function(file , ext) {
},
onComplete: function(file, response) {
// enable upload button
// this.enable();
$("#slide-" + currentId).find(".movie-image").attr("src", baseImgPath + file);
$("#mImg" + currentId).val(file);
}
});
任何想法表示讚賞。 :)
編輯您的文章(代碼),請...這是很難讀... – Reigel 2010-01-25 19:00:57