Skip to content

Instantly share code, notes, and snippets.

@domitry
Created January 8, 2015 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domitry/600ea5618da0f3cc4274 to your computer and use it in GitHub Desktop.
Save domitry/600ea5618da0f3cc4274 to your computer and use it in GitHub Desktop.
<html>
<head>
<script>
window.onload = function(){
var obj = {hoge: "nya", nya: {hoge: 123}};
var content = JSON.stringify(obj);
var uriContent = "data:application/json," + encodeURIComponent(content);
var newWindow=window.open(uriContent, 'hoge.json');
};
</script>
</head>
<body>
Hello
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment