Skip to content

Instantly share code, notes, and snippets.

View LarryKHite's full-sized avatar
💭
I may be slow to respond.

LarryKHite LarryKHite

💭
I may be slow to respond.
  • Canada
View GitHub Profile
@LarryKHite
LarryKHite / forceDownload.js
Created October 27, 2018 12:58 — forked from jmcarp/forceDownload.js
Forcing a file download in JavaScript
function forceDownload(href) {
var anchor = document.createElement('a');
anchor.href = href;
anchor.download = href;
document.body.appendChild(anchor);
anchor.click();
}