Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

generate and download xml from javascript

var xmltext = "<sometag><someothertag></someothertag></sometag>";

var filename = "file.xml";
var pom = document.createElement('a');
var bb = new Blob([xmltext], {type: 'text/plain'});

pom.setAttribute('href', window.URL.createObjectURL(bb));
pom.setAttribute('download', filename);

pom.dataset.downloadurl = ['text/plain', pom.download, pom.href].join(':');
pom.draggable = true; 
pom.classList.add('dragout');

pom.click();
Comment

PREVIOUS NEXT
Code Example
Javascript :: react increment multipying button click 
Javascript :: how to get first element of an array in javascript 
Javascript :: split string every nth characters javascript 
Javascript :: docker remove json log 
Javascript :: .text javascript 
Javascript :: file_get_contents in javascript 
Javascript :: create node js server 
Javascript :: reduce object to array javascript 
Javascript :: update map value javascript 
Javascript :: react chrome extension 
Javascript :: convert set to array javascript 
Javascript :: set cors for a react node application socket error 
Javascript :: disable long press on chrome 
Javascript :: string into json javascript 
Javascript :: react make setstate synchronous 
Javascript :: react history listen get previous location 
Javascript :: nodejs exit code 
Javascript :: prependchild javascript 
Javascript :: live search javascript 
Javascript :: geojson 
Javascript :: convert js date time to mysql datetime 
Javascript :: javascript remove scientific notation 
Javascript :: get json data into object 
Javascript :: foreach in react 
Javascript :: react mid senior dev interview questuions 
Javascript :: vue 3 create app 
Javascript :: jquery replicate div on drag 
Javascript :: how to apply border to table in angular 
Javascript :: react native use route params 
Javascript :: js substr 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =