javascript download current html page
// in the current page, download the html source
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:attachment/text,' + encodeURI(document.documentElement.outerHTML);
hiddenElement.target = '_blank';
hiddenElement.download = 'myFile.txt';
hiddenElement.click();var textToSave = 'this is a test';
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave);
hiddenElement.target = '_blank';
hiddenElement.download = 'myFile.txt';
hiddenElement.click();
Also in JavaScript:
- npm react router 6.0.0-alpha.2
- how to do radio button validation in jquery
- javascript forEach return
- how to make 1st letter capital in ejs
- removing first item array js
- The server responded with error 50007
- objeto con método javascript
- jquery styles
- wait javascript
- how to send json data in fetch request body
- javascript recursive fibonacci
- how to display data from json api using flutter expansiontile
- javascript sum of array
- js ceil
- how to show multiple image preview in jquery
- declare an object in jquery\
- discord js bot leave voice channel
- print in javascript
- display none in jquery
- vue test utils mapgetter
- npm ERR! 503 Service Unavailable: npm@latest
- input type date doesn't work in ie
- javascript map value nested object
- rxjs coding example