<html>
<head>
<head><meta charset="utf-8" name=”viewport”content=”width=device-width,initial-scale=1″/></head>
<title>一键保存</title><link rel="shortcut icon" href="n2.ico" type="image/x-icon">
<script type="text/javascript">function downloadImage(filename, url) {fetch(url).then((res) => res.blob()).then((blob) => {// create URL and Linkconst url = window.URL.createObjectURL(blob);const a = document.createElement("a");a.href = url;a.download = filename;document.body.appendChild(a);// Invoke downloada.click();// remove URL and Linkwindow.URL.revokeObjectURL(url);a.remove();}).catch((err) => console.error(err.message));
}function downloadImages(urls) {obj = document.getElementsByClassName("image");for (var i = 0; i<obj.length;i++){var url = obj[i].src;setTimeout(() => {// codes for downloading an imagedownloadImage(`${Date.now()}`, url);}, i * 1000);}
}
downloadImages();
</script>
</head>
<body bgcolor="#ccffcc">
<table width="390" border="2" align="center"><tr><td><img class="image" src="20220330.jpg" width="390" height="390"><img class="image" src="20220330.jpg" width="390" height="390"><img class="image" src="20220330.jpg" width="390" height="390"><img class="image" src="20220330.jpg" width="390" height="390"><img class="image" src="20220330.jpg" width="390" height="390"></td></tr><tr><td><button onclick="downloadImages()">一键保存</button></td></tr>
</table>
</body>
</html>