function saveImg (Url) {
var blob=new Blob([’’], {type:‘application/octet-stream’});
var url = URL.createObjectURL(blob);
var a = document.createElement(‘a’);
a.href = Url;
a.download = Url.replace(/(./)([^.]+.*)/ig,"$2").split("?")[0];
var e = document.createEvent(‘MouseEvents’);
e.initMouseEvent(‘click’, true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
a.dispatchEvent(e);
URL.revokeObjectURL(url);
}
jQuery 下载保存图片的方法
最新推荐文章于 2024-04-10 18:01:19 发布