这里是jQuery代码如何使用此代码
$(function(){
var file_type = '';
var btnUpload=$('#BackgroundimageUpload');
var status=$('.status');
new AjaxUpload(btnUpload, {
action: "common_files/cover_image_change.php",
//Name of the file input box
name: 'uploadfile',
onSubmit: function(file, ext){
file_type = ext;
status.html('uploading....');
},
onComplete: function(file, response){
//On completion clear the status
status.html('');
//Add uploaded file to list
if(response==="upload_error"){
alert("Error in upload");
} else{
var imgHtml = '<br/><br/><div><img src="uploads/'+response+'" style="width:100%; height:1004;" /></div>';
$("#timelineBackgroundUploading").html('');
$("#timelineBackgroundUploading").append(imgHtml);
}
}
});
});
`
这是上面的代码我传递一个参数到PHP文件,我想通过一个参数(ID)到PHP文件。我怎样才能做到这一点。
格式化您的问题 – 2015-04-03 04:34:59
不要尝试在评论中放置长代码块。把它放在问题中,以便可以将其格式化为可读。 – Barmar 2015-04-03 04:36:41
你能给出一个链接到你正在使用的'AjaxUpload'插件的位置吗?我无法用Google找到它的文档。 – Barmar 2015-04-03 04:42:39