Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun beautify-json ()
- (interactive)
- (let ((b (if mark-active (min (point) (mark)) (point-min)))
- (e (if mark-active (max (point) (mark)) (point-max))))
- (shell-command-on-region b e
- "python -mjson.tool" (current-buffer) t)))
- (define-key json-mode-map (kbd "C-c C-f") 'beautify-json)
- var myJSObject = {
- attr: {foo: "bar", baz: ["quux", "truc", "pouet"]},
- fooAlert: function (num) {
- alert(this.attr.foo+' '+num);
- }
- };
- myJSObject.fooAlert(42);
Add Comment
Please, Sign In to add comment