Skip to content

Instantly share code, notes, and snippets.

Avatar
🐶
Focusing

Anastasiia Nas10ka

🐶
Focusing
View GitHub Profile
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@Nas10ka
Nas10ka / JsBlobSaveJson
Created Nov 1, 2019 — forked from yiwenl/JsBlobSaveJson
Javascript using Blob to save json file
View JsBlobSaveJson
var saveJson = function(obj) {
var str = JSON.stringify(obj);
var data = encode( str );
var blob = new Blob( [ data ], {
type: 'application/octet-stream'
});
var url = URL.createObjectURL( blob );
var link = document.createElement( 'a' );
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
You can’t perform that action at this time.