function forDownLoad()
{
var row = grid.getCurrentLine();
var filepath = grid.getCellValue(row,3);
var primaryKey = parent.grid.getCheckLine();
var aLink = document.getElementsByTagName("A")[0];
var filePath = filepath;
var fileName = grid.getCellValue(grid.getCurrentLine(),2);
var sel=grid.getCheckLine();
if(sel==""){
alert("请选择一条记录!");
return;
}
var url="/client/certexamine".replace('certexamine','bpmcommon');
//用于判断文件是否被删除
$.ajax({
url:url+"/workFlowForm/loginFileExists.so",
data:"filePath="+filePath,
async:false,
success:function(msg){
if(msg=='true'){
}else{
//缓存证书图片到服务器端
document.forms[0].action = "/client/certexamine/certExamineForm/cachePic.so?certID="+primaryKey;
document.forms[0].submit();
}
}
});
var hrefCopy = aLink.href;
//实现将文件名换回原始文件名
aLink.href = aLink.href+filePath+"&fileName="+fileName;
aLink.click();
aLink.href = hrefCopy;
}
代码是这样的,要走完aLink.click();后台才会进
document.forms[0].action = "/client/certexamine/certExamineForm/cachePic.so?certID="+primaryKey;
这个方法。
怎么实现后台进方法在aLink.click();之前呢。