Hacker News new | past | comments | ask | show | jobs | submit login

Note that the "download" attribute is extremely useful when the href is a data or blob URI [1]. This allows you to construct the file that the user is going to get in Javascript, rather than server-side. For example, if you wanted to write an image-editing web app and didn't want to round-trip to the server to allow them to download a copy.

https://en.wikipedia.org/wiki/Data_URI_scheme




Yeah, this is useful. You can generate the URI in a click handler as well, so if you need to do some last minute assembly it still seems to work like a regular download link.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: