Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js download

function downloadURI(uri, name) 
{
    var link = document.createElement("a");
    // If you don't know the name or want to use
    // the webserver default set name = ''
    link.setAttribute('download', name);
    link.href = uri;
    document.body.appendChild(link);
    link.click();
    link.remove();
}
Comment

javascript download

<a onclick="this.href='data:text/html;charset=UTF-8,'+encodeURIComponent(document.documentElement.outerHTML)" href="#" download="page.html">Download</a>
Comment

js download

function downloadText(filename, text) {
    Object.assign(document.createElement('a'), {
      download: filename,
      href: 'data:text/plain;charset=utf-8,' + encodeURIComponent(text),
    }).click()
  }
Comment

PREVIOUS NEXT
Code Example
Javascript :: @input in angular 
Javascript :: random color generator 
Javascript :: sails disable grunt 
Javascript :: Convert mnemonic to seed in javascript 
Javascript :: Query all object in mongo array to satisy condition 
Javascript :: set up emet for jsx in vs code 
Javascript :: The element.onclick Property 
Javascript :: spray scala JSON formatter override def read examples 
Javascript :: floor javascript 
Javascript :: iconify react 
Javascript :: node express dynamic route and error handler 
Javascript :: vuejs pass all events to child 
Javascript :: js alertify.success parameters 
Javascript :: ajax async call with wall all 
Javascript :: TypeError: fxn.call is not a function 
Javascript :: react extends component Increment data 
Javascript :: color picker in react js 
Javascript :: nodejs add to array 
Javascript :: factorial bigger than 170 javascript 
Javascript :: sails setup 
Javascript :: react native swipe screen 
Javascript :: React ES6 Arrow Functions 
Javascript :: write data in props.histroy.push in react component 
Javascript :: react counter animation 
Javascript :: get text selection javascript 
Javascript :: fake delay in fetch 
Javascript :: same date to string in javascript minus and days difference 
Javascript :: nodejs express routing get 
Javascript :: mongodb find array with element 
Javascript :: json returning object object 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =