dojo.xhrPost

by phusick

JavaScript

var data = {
    Introduction: 
    [
        {
            title:   "Introduction",
            toolbar: "Page 1",
            content: "cont, aabitant morbi tristique..."
        },
        {
            title:  "Introduction",
            toolbar: "Page 2",
            content:  "contesent vel nisi ipsum..."
        }
    ],
    Services: 
    [
        {
            title:   "services",
            toolbar: "Page 1",
            content: "Cras adipiscing sapien nec..."
        }
    ]
};

dojo.xhrPost({
    url: "/echo/json/",
    content: {
        json: dojo.toJson(data)
    },
    handleAs: "json",
    load: function(response) {
        console.log(response);    
    }
});