214 Star 4K Fork 1.1K

qianming / css效果图收集

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
下载文件.html 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<input type="text" id="input" style="width: 100%;height: 40px;">
<button onclick="download()">点击瞎子啊</button>
<script>
const input = document.getElementById('input')
function download() {
const url = input.value;
const sa = url.split('/');
const fileName = sa[sa.length - 1];
// fetch({
// url, method: 'GET', responseType: 'blob',
// })
fetch(url, {
method: 'GET',
mode: 'cors',
}).then(res => {
console.log('1111111111111111', res);
})
// fetch(url, {
// method: 'GET',
// responseType: 'blob'
// }).then((response) => {
// console.log(response);
// const downloadUrl = window.URL.createObjectURL(new Blob([response.data]));
// const link = document.createElement('a');
// link.style.display = 'none';
// link.href = downloadUrl;
// link.setAttribute('download', fileName);
// document.body.appendChild(link);
// link.click();
// document.body.removeChild(link);
// });
}
</script>
</body>
</html>
CSS
1
https://gitee.com/qm1989/css_effect_map_collection.git
git@gitee.com:qm1989/css_effect_map_collection.git
qm1989
css_effect_map_collection
css效果图收集
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891