Force download of ‘data:text/plain’ URL

As of now, it has been made possible to use <a download> in Chrome. Using dispatchEvent, you can download any string as file (even with a custom filename) whenever you want. Here’s a utility function to use it: var downloadFile = function(filename, content) { var blob = new Blob([content]); var evt = document.createEvent(“HTMLEvents”); evt.initEvent(“click”); $(“<a>”, … Read more

Data URI scheme and Internet Explorer 9 Errors

Data URIs cannot be used for navigation, for scripting, or to populate frame or iframe elements in IE. According to Data URIs are supported only for the following elements and/or attributes. object (images only) img input type=image link CSS declarations that accept a URL, such as background, backgroundImage, and so on. Data URIs can … Read more