当前位置:网站首页>JS download files through URL links
JS download files through URL links
2022-07-03 13:59:00 【pzy_ six hundred and sixty-six】
Scenario description
ajax After the request , Back end export interface , What is returned is the of the exported file url link
Realization
const elt = document.createElement('a');
elt.setAttribute('href', url);
elt.setAttribute('download', 'file.png');
elt.style.display = 'none';
document.body.appendChild(elt);
elt.click();
document.body.removeChild(elt);
边栏推荐
- 太阳底下无新事,元宇宙能否更上层楼?
- Record 405 questions about bank callback post request
- Golang — 命令行工具cobra
- 又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了
- Summary of common error reporting problems and positioning methods of thrift
- GoLand 2021.2 configure go (go1.17.6)
- [technology development-24]: characteristics of existing IOT communication technology
- Dlopen() implements dynamic loading of third-party libraries
- 全局事件总线
- Depth and breadth first traversal of tree (regardless of binary tree)
猜你喜欢
28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
GoLand 2021.1.1: configure the multi line display of the tab of the open file
【吉林大学】考研初试复试资料分享
QT learning 17 dialog box and its types
核酸修饰的金属有机框架药物载体|PCN-223金属有机骨架包载Ad金刚烷|ZIF-8包裹阿霉素(DOX)
掌握Cypress命令行选项,是真正掌握Cypress的基础
Implementation of Muduo accept connection, disconnection and sending data
There is nothing new under the sun. Can the meta universe go higher?
Golang - command line tool Cobra
交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳
随机推荐
Use vscode to view hex or UTF-8 codes
HALCON联合C#检测表面缺陷——HALCON例程autobahn
解决MySql 1045 Access denied for user ‘root‘@‘localhost‘ (using password: YES)
Go language web development series 25: Gin framework: using MD5 to verify the signature for the interface station
Function calling convention
Go language unit test 3: go language uses gocovey library to do unit test
Similarities and differences of sessionstorage, localstorage and cookies
掌握Cypress命令行选项,是真正掌握Cypress的基础
Bidirectional linked list (we only need to pay attention to insert and delete functions)
Richview trvstyle liststyle list style (bullet number)
Installation impression notes
jvm-对象生命周期
Heap structure and heap sort heapify
【BW16 应用篇】安信可BW16模组与开发板更新固件烧录说明
Unable to stop it, domestic chips have made another breakthrough, and some links have reached 4nm
[understanding by chance-37]: the structure of human sensory system determines that human beings are self-centered
[bw16 application] instructions for firmware burning of Anxin Ke bw16 module and development board update
JVM系列——概述,程序计数器day1-1
Multi person collaborative data annotation based on Baidu brain easydata from scratch
Qt学习25 布局管理器(四)