2 ms·
That's a pretty good idea -- perhaps a "prompt" attribute instead of a "download" attribute. Lends itself reasonably well to a JS-only implementation, too:
by wwweston 14y ago
That's a pretty good idea -- perhaps a "prompt" attribute instead of a "download" attribute.
Lends itself reasonably well to a JS-only implementation, too:
http://jsfiddle.net/FLa8P/1/
- jakerocheleau 14y agoAwesome fiddle! Thanks for sharing that here, it's definitely a unique solution.
- jrochkind1 14y agoNice, that JS is a great idea, thanks. And of course it relies on the download attribute. So, okay, I guess the `download` attribute DOES make this possible with a bit of JS, where it wasn't before, okay, one step forward. One nice feature of your solution is the user can still skip the prompt with a right-click or modifier-click 'save as' or 'open in new tab'. Nicely done. I'm gonna use that in the future. To be more strictly legal, I'd use a `data-prompt="true"` attribute or something, instead of a not entirely legal made up 'prompt' attribute.