ajax json example

by satish2437

JavaScript

new Request.JSON({
    url: '/echo/json/',
    data: {
        json: JSON.encode("hello jsfiddle")
    },
    onSuccess: function(res) {
        document.write(res);
    }
}).send();