Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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();
Comment

PREVIOUS NEXT
Code Example
Javascript :: firebase read data javascript 
Javascript :: how to use static file node js 
Javascript :: javascript localstorage 
Javascript :: js date enlever jour 
Javascript :: return symmetric difference of the array javascript 
Javascript :: javascript check if element is visible on screen 
Javascript :: node mysql 
Javascript :: short if 
Javascript :: js get form inputs 
Javascript :: how to scroll to an element javascript react 
Javascript :: map javascript index 
Javascript :: js add content to script tag 
Javascript :: js ternary 
Javascript :: flatten an array without using .flat(); 
Javascript :: check online status javascript 
Javascript :: cypress command return value into variable 
Javascript :: add an array to another array javascript 
Javascript :: extract all link with javascript 
Javascript :: how to set css variables in javascript 
Javascript :: foreach db mongodb 
Javascript :: get value from json object in javascript 
Javascript :: angular ngfor counter 
Javascript :: how to know if ajax is running 
Javascript :: mongodb group by several fields 
Javascript :: react-native eject not working 
Javascript :: react cheat sheet 
Javascript :: how to identify specific letter from a string in javascript 
Javascript :: javascript declare a variable 
Javascript :: angular generate without spec 
Javascript :: add tab to textarea javascript 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =