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
Based on Vue and native javascript encapsulation,...
When I was taking a break, a phone call completel...
MySQL download and installation (version 8.0.20) ...
Table of contents introduce Usage scenarios Sourc...
As an entry-level Linux user, I have used simple ...
This article example shares the specific code for...
The following two functions are used in the same ...
Table of contents 1. Steps 1. Define buttom permi...
Preface What is data type conversion? The default...
1. Introduction As we all know, in the applicatio...
Table of contents Environment Preparation start 1...
0. Environment Operating system for this article:...
<button> tag <br />Definition and usag...
Table of contents Preface start step Troubleshoot...
1. Introduction In the past, if you wanted to sta...