Last active
August 29, 2015 14:06
-
-
Save ggirou/8ea418bac623a6fceeb1 to your computer and use it in GitHub Desktop.
js-veb: JavaScript Value Editor Bookmarklet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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