For details about the html download function _ HTML/Xhtml _ webpage Creation

Source: Internet
Author: User
The following is a detailed explanation of the html download function. I think it is quite good. Now I will share it with you and give you a reference. Let's take a look at the new project. The first time we completed the integration of frontend and backend separation, we naturally encountered a lot of pitfalls.

Let's talk about one of the pitfalls we encountered on the first day.

-- About download...

In the past, we all liked to use tags. At first, I used the tag and href attribute to simulate the download function at the image address. It turns out that you click this ghost thing to open a new image, not to download it.

Then I read an article and opened the door to the new world of my baby.

Download attributes

The tag must have the href attribute. The browser will automatically detect the correct file extension and add it to the file (. img,. pdf,. txt,. html, and so on ).

For example:

You can also customize the downloaded file name

WageSoCute.jpg ">

However, this method also has great limitations.

One is its compatibility, based on the data provided by W3C.

In this case, it seems that this attribute is generally practical for the moment.

Another pitfall is that I haven't stepped on yet, that is, cross-domain issues. When I stepped on, I updated it ..

To sum up, this download is a good thing, but it looks likePoor SupportI don't know what will happen to him in the future. After all, it is still a new attribute of the tag. Let's wait. Now, at least we know that there is such a thing.

The above detailed explanation of the html download function is all the content that I have shared with you. I hope you can give us a reference and support the script home.

Address: http://www.cnblogs.com/w-age666/archive/2016/05/04/5458342.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.