js Ajax
function export_assessProject(){
var t1 = new Date();
/////////////////////////利用ajax方式生成文件目录并返回文件路径列表///////////////////////
var xmlhttp;
try{
xmlhttp = new XMLHttpRequest();
}catch(e){
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function(){
if(4 == xmlhttp.readyState){
if(200 == xmlhttp.status){
var list = eval("(" + xmlhttp.responseText + ")");
var chinaExcel = window.top.topFrame.chinaExcelTool.getObj();
for(var i = 0;i < list.length;i = i + 2){
with(chinaExcel){
//2:利用chinaexcel生成excel文件
ReadDataFromString(list[i + 1]);
WriteToExcelFile(list[i]);
}
}
}
}
}
xmlhttp.open("post","queryAssessProjectCatalogue.do",false);
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlhttp.send("PROJECT_ID=" + PROJECT_ID + "&SUB_SYSTEM_ID=" + SUB_SYSTEM_ID + "&QJ_TYPE=" + QJ_TYPE);
//3:压缩文件成zip格式,并下载文件和删除该临时文件
alert(new Date() - t1);
window.location="exportAssessProject.do?projectId="+PROJECT_ID;
}
补充:web前端 , JavaScript ,