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
1. Check the kali linux system version Command: c...
Preface In the previous article, I shared with yo...
The PC version of React was refactored to use Ama...
Intro Previously, our docker images were stored i...
This article shares the specific code of canvas t...
1. Use xshell to connect to the virtual machine, ...
1. Let's look at a table creation statement f...
Step 1: Change DATABASES in setting.py # Configur...
Table of contents 1. Bootstrap5 breakpoints 1.1 M...
mysql query control statements Field deduplicatio...
This article mainly records the problems and solu...
This article uses examples to describe how to use...
Table of contents 1. What is a cursor? 2. How to ...
Table of contents Preface 1. Overview 2. Read-wri...
Today, I logged into the server and prepared to m...