Hey guys,
I am using the AjaxUpload plugin with jQuery, and everything is working fine for the most part, but I have to click my button twice to get it to execute. I'm guessing this is a scope issue... or(?) still learning...
Here is my code:
$(".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);
}
});
Any ideas are appreciated. :)