jquery的bug?
$.each(fileLists,function(index,comm){
html+='<tr class="table-odd-row">'
+'<td class="table-string-column">'+'<a href="javascript:void(0)" onclick="return deleteFile('+comm['fileNo']+');"><img src="${ctx}/images/u78.png" width="16" height="16" border="0" alt="刪除"></a>'+'</td>'
+'<td class="table-other-column">'+'<a href="<%=request.getContextPath()%>/<%=PFMConstants.PFM_MODULE_FILE_UPLOAD_INFO%>/downloadFile.htm?wh=temp&fileName='+comm['aliasFileName']+'" onclick="return checkFileExist('+index+');">'+comm['fileName']+'</a>'+'</td>'
+'<td class="table-other-column">'+comm['strUploadDate']+'</td>'
+'<td class="table-other-column">'+comm['uploadUser']+'</td>'
+'<td class="table-other-column">'+comm['fileSize']+'</td>'
+'<td class="table-other-column">'+comm['comments']+'</td>'
+'</tr>';
});
jquery调用中,如上method中,調用checkFileExist時候,传递参数是字符串的时候就有问题(是数字则无问题),js报:
identifier starts immediately after numeric literal
[在此错误处中断]
return checkFileExist(1328780305514_fileUploadInfoModule_SpringinAction,ThirdEdi...
有谁遇到过?
//判斷檔案是否存在
function checkFileExist(fileName){
alert(fileName);
var flag = null;
$.ajax({url:"<%=request.getContextPath()%>/<%=PFMConstants.PFM_MODULE_FILE_UPLOAD_INFO%>/checkFileName.htm", //URL
cache:"False",
type:"get",
async: false,//同步校驗
data:{fileName:fileName},//傳入的參數
success:function(data, textStatus){//回調方法
var isOk = JSON.parse(data);
if(isOk != null){
if(isOk == false){
alert("檔案不存在!");
flag = false;
}else if(isOk == true){
flag = true;
}
}
}});
return flag;
}
[解决办法]
这代码实在看不下去...
js嵌着jsp再加上内部嵌套...
你自己页面显示出来以后,去查看源文件
看哪个地方写错了
[解决办法]
字符串啊。。。。少了2个点,这个要变通一下,既然解决了,公布答案吧
[解决办法]
字符串拼接挺头疼的。。
[解决办法]
字符拼接问题