使用jquery插件上传图片的问题
jsp代码:
<td style="width: 220px;" align="left">
<input type="text" readOnly maxlength="20" id="attachRealName" class="left" />
<span id="spanButtonPlaceHolder"></span>
<img id="uploadImg""/> <!-- 显示图片 -->
<div style="width: 150px; height: 2px;" id="fsUploadProgress"></div>
<div id="divStatus">0个文件已经上传</div>
<div id="content" style="display: none;">
<input id="btnCancel" type="button" value="Cancel All Uploads"
onclick="swfu.cancelQueue();" disabled="disabled"
style="margin-left: 2px; font-size: 8pt; display: none" />
<span id="batchNoUploadId" style="display: none;"></span>
<input type="hidden" id="imageId" name="imageId" />
</div></td>
JS代码
function initCommonUpload() {
// $("#divStatus").hide();
$("#uploadImg").css("display", "none");
var attach = new Object();
attach.attachNo = generateNo("member");
attach.attachNotes = "";
attach.attachType = "pic";
attach.picType = "";
attach.splitKey = "";// 定义图片切割大小
attach.fileType = "*.jpg;*.gif;*.png;";
attach.fileCount = "singleSelect"; // singleSelect 表示一次只能选择一个文件上传
initUpload('spread_','pics/member/spread',attach);
}
function commonSuccessReturn(attachList){
var len = attachList.length;
for(var i=0;i<attachList.length;i++){
if(attachList[i].picType==""){
$('#imageId').val(attachList[i].attachId);
$('#attachRealName').val(attachList[i].attachRealName);
var imgPath=images1Path+attachList[i].attachPath;
var idcard=images1Path+attachList[i].attachPath;
$("#uploadImg").css("display", "block");
$('#uploadImg').attr("src",imgPath);
}
}
}
问题1:attach.attachNo = generateNo("member"); 这里的member是什么?
问题2:在这个jsp页面,我想要有多个上传按钮,应该怎么做?
------解决方案--------------------一个上传控件,对应一个初始化的js里面的属性方法。另外要注意js和jsp里面的Id问题。