Here is what you need. But it’s not cross-browser yet. Works in Google Chrome.
<a download="MyFile.txt"
href="https://stackoverflow.com/questions/6464828/your-data-uri-here"
draggable="true"
class="dragout"
>Download ready</a>
Also Wikipedia has a good article about Data URI
Related Contents:
- Is there any way to specify a suggested filename when using data: URI?
- Download data URL file
- Should setting an image src to data URL be available immediately?
- How to create a Web Worker from a string
- Convert HTML to data:text/html link using JavaScript
- execCommand() is now obsolete, what’s the alternative?
- Javascript trick for ‘paste as plain text` in execCommand
- document.execCommand() FontSize in pixels?
- Cannot use `document.execCommand(‘copy’);` from developer console
- Ways to deal with #document under iframe
- Event on a disabled input
- How to efficiently count the number of keys/properties of an object in JavaScript
- Get current URL with jQuery?
- Deleting Objects in JavaScript
- ng-repeat finish event
- Using an HTML button to call a JavaScript function
- SyntaxError: Cannot use import statement outside a module
- JavaScript merging objects by id
- Maximum size of an Array in Javascript
- AngularJS with Django – Conflicting template tags
- Find mouse position relative to element
- Electron require() is not defined
- jQuery selector for id starts with specific text [duplicate]
- (change) vs (ngModelChange) in angular
- Breakpoint on property change
- Failed to load c++ bson extension
- How to define custom sort function in javascript?
- How to set header and options in axios?
- Break promise chain and call a function based on the step in the chain where it is broken (rejected)
- How to use Javascript to read local text file and read line by line?
- Better way to get type of a Javascript variable?
- Using filesystem in node.js with async / await
- Selenium Datepicker using JavascriptExecutor
- What does ‘x packages are looking for funding’ mean when running `npm install`?
- Load and execute external js file in node.js with access to local variables?
- Why cache jQuery objects?
- Return an empty Observable
- Chrome sets cursor to text while dragging, why?
- Any way to get a bounding box from a three.js Object3D?
- Check if value exists in firebase DB
- Can I determine if a string is a MongoDB ObjectID?
- Does Javascript slice method return a shallow copy?
- How to print a PDF from the browser
- javascript object max size limit
- Javascript Performance: While vs For Loops
- option.style.display = “none” not working in safari [duplicate]
- How can I modify the XMLHttpRequest responsetext received by another function?
- When should I automatically create an object even if `new` is forgotten?
- Using pre-compiled templates with Handlebars.js (jQuery Mobile environment)
- Angular.js ng-repeat filter by property having one of multiple values (OR of values)