function down(id, name) f
var xhr a newXMLHttpRequest();
xhr .open(' post ',"front/yysd/ download?xh="+ id,true);
xhr .setRequestHeader("Content -Type"," application/x-www-from-urlencoded; charset=utf-8");
xhr. responseType ="blob";
xhr onload . function (){if(this. status ===200)(
var blob =this. response;if(blob.type =="text/html"){tip("错误");returnfalse;}
var filrName = name +'.pdf';if(window. navigator .msSave0r0penBlob){
navigator -msSaveBlob(blob, filrName);}else{
var link = document.createElenent('a');1ink.href = window.URL.create0bjectURL(blob);
link. download = filrName;
link.click();
$(link)remove();
sindoN.URL.revokeObjectURL(link ,href);}}else{
fiframe.tip("请求错误!");}};
xhr.send();}