$('.downLoad').click(function () {
var x = new XMLHttpRequest();
//var resourceUrl = "http://static.xuezhong100.com/uploadfile/20190401/45549715ba2e428b8e415a30d9392c97.doc";
// var resourceUrl = 'http://static.xuezhong100.com/uploadfile/20190401/59a00a5259004f459f79a541dd05f1c3.pptx';
//var resourceUrl = "http://static.shuxuejia.com/img/201708020.gif";
var resourceUrl = "http://192.168.1.17:8167/FileSource/ThematicMap/20200331095832.png";
x.open("GET", resourceUrl, true);
x.responseType = 'blob';
x.onload = function (e) {
// ie10+
if (navigator.msSaveBlob) {
var name = resourceUrl.substr(resourceUrl.lastIndexOf("/") + 1);
return navigator.msSaveBlob(x.response, name);
} else {
var url = window.URL.createObjectURL(x.response)
var a = document.createElement('a');
a.href = url;
a.download = '降雨分布图';
a.click();
}
}
x.send();
})