function doconsultation() { $(".nb-group-text").click(); } function dodownload() { $.ajax({ type: "post", url: "../appcenter/ishaveinfo", data: { type: $("#title").text() }, datatype: "text", success: function (result) { if (result.tolowercase() == "true") { $("#downloaddoc").click(); } else { if (mybrowser() === "ie" || mybrowser() === "edge") { window.open(document.getelementbyid("path").textcontent); //var opop = window.open(document.getelementbyid("path").textcontent); //for (; opop.document.readystate != "complete";) { // if (opop.document.readystate == "complete") break; //} //opop.document.execcommand("saveas"); //opop.close(); } else { //var odownload = document.getelementbyid("path"); //odownload.download = ""; document.getelementbyid("path").click(); } $.post("../appcenter/practicalhasip", { type: $("#title").text()}, function (data) { var data = eval(data); }, "json"); } }, error: function (result) { alert(result); } }); } //判断浏览器内核 function mybrowser() { var useragent = navigator.useragent; //取得浏览器的useragent字符串 var isopera = useragent.indexof("opera") > -1; if (isopera) { return "opera" }; //判断是否opera浏览器 if (useragent.indexof("firefox") > -1) { return "ff"; } //判断是否firefox浏览器 if (useragent.indexof("chrome") > -1) { return "chrome"; } if (useragent.indexof("safari") > -1) { return "safari"; } //判断是否safari浏览器 if (useragent.indexof("compatible") > -1 && useragent.indexof("msie") > -1 && !isopera) { return "ie"; }; //判断是否ie浏览器 if (useragent.indexof("trident") > -1) { return "edge"; } //判断是否edge浏览器 }