Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

dlowlad the json fiel in react js pretty formate

private exportToJson(objectData: SomeObject) {
    let filename = "export.json";
    let contentType = "application/json;charset=utf-8;";
    if (window.navigator && window.navigator.msSaveOrOpenBlob) {
      var blob = new Blob([decodeURIComponent(encodeURI(JSON.stringify(objectData)))], { type: contentType });
      navigator.msSaveOrOpenBlob(blob, filename);
    } else {
      var a = document.createElement('a');
      a.download = filename;
      a.href = 'data:' + contentType + ',' + encodeURIComponent(JSON.stringify(objectData));
      a.target = '_blank';
      document.body.appendChild(a);
      a.click();
      document.body.removeChild(a);
    }
  }
Comment

PREVIOUS NEXT
Code Example
Javascript :: input creates console log delay 
Javascript :: jquery slick remove white fade 
Javascript :: how to style elements that had ben added with inner html js 
Javascript :: reinitialise or reset all values in mapping in solidity 
Javascript :: JavaScript object numeric keys 
Javascript :: Refresh page after dialoge closes 
Javascript :: javascript regex tester online 
Javascript :: concat and asign operator js 
Javascript :: readonly checkbox angular 
Javascript :: how to get the value of state of on and off 
Javascript :: Increment counter each time an element is clicked 
Javascript :: for const 
Javascript :: cant resolve module after typescript install 
Javascript :: Search specific products in the array in javascript 
Javascript :: Add Navbar to React Redux CRUD App 
Javascript :: convert string to charcode js 
Javascript :: Mutations 
Javascript :: jquery select change price 
Javascript :: js import 
Javascript :: full screen window open and disable all apps by javascript 
Javascript :: evaluate polynomial 
Javascript :: using nodejs cart price calculation 
Javascript :: jquery swap table rows 
Javascript :: fetch hook 
Javascript :: express static page 
Javascript :: nested json example 
Javascript :: npmjs invoice template 
Javascript :: check trigger is human jquery 
Javascript :: ajax status update switch toggle 
Javascript :: binary conversion recursion in javascript 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =