The new project has basically come to an end. It was the first time I completed the integration of front-end and back-end separation, and naturally I encountered many pitfalls. Let’s talk about one of the pitfalls I encountered on the first day. ——About downloading issues. . . In the past, everyone liked to use the <a></a> tag. At the beginning, I also used the a tag and placed the href attribute in the address of the picture to simulate the download function. It turns out that this damn thing, when you click on it, it directly opens a new picture, it doesn't mean downloading. Then, I read an article, which opened the door to a new world for me. download attribute The <a> tag must have an href attribute. The browser will automatically detect the correct file extension and add it to the file (.img, .pdf, .txt, .html, etc.). For example, let's take an example: <a href="ccc.jpg" download> You can also customize the downloaded file name. <a href="ccc.jpg" download=" wageSoCute .jpg"> But in fact, this method also has great limitations. One is its compatibility, according to data provided by W3C. It seems that the practicality of this attribute is actually average for the time being. There is another pitfall that I haven't encountered yet, which is the cross-domain issue. I will update it after I encounter it. . In conclusion, this download is a good thing, but it seems that the support is not very good . I wonder how it will develop in the future. After all, it is still a new attribute of the a tag. Let's wait and see. At least we know that there is such a thing. The above detailed explanation of the html download function is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. Original URL: http://www.cnblogs.com/w-age666/archive/2016/05/04/5458342.html |
<<: MySQL transaction isolation level details
>>: Drop-down menu implemented by HTML+CSS3+JS
Preface: Recently, the company project changed th...
vuex-persistedstate Core principle: store all vue...
Table of contents JavaScript function call classi...
When installing in MySQL 8.0.16, some errors may ...
Overlay network analysis Built-in cross-host netw...
Written in front In recent years, the live stream...
When the front-end and back-end interact, sometim...
A simple license plate input component (vue) for ...
mysql5.5.28 installation tutorial for your refere...
Table of contents Preface What does yarn create d...
There are two main reasons why it is difficult to...
This article mainly introduces how to evenly dist...
How to uninstall Mysql perfectly? Follow the step...
We are all familiar with the tr command, which ca...
MySQL 5.7 MySQL command line client using command...