Skip to content

Instantly share code, notes, and snippets.

@ggirou
Last active August 29, 2015 14:06
Show Gist options
  • Save ggirou/8ea418bac623a6fceeb1 to your computer and use it in GitHub Desktop.
Save ggirou/8ea418bac623a6fceeb1 to your computer and use it in GitHub Desktop.
js-veb: JavaScript Value Editor Bookmarklet
(function(){
var form = {a: 123, b: 456, c: {d: 789}};
var d = window.open(null, "_blank").document;
d.write('<textarea id="value" style="width:100%;height:90%;"></textarea>');
d.write('<br><input type="button" onclick="javascript:opener.callback()" value="Changer">');
var t = d.querySelector('#value');
t.value = JSON.stringify(form, null, 2);
window.callback = function() {
form = JSON.parse(t.value);
window.alert(JSON.stringify(form, null, 2));
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment