JSFiddle - React, Tailwind, and code Playground

by Caleb Maclennan

JavaScript

dojo.xhrPost({
    url: location.href,
    handleAs: "json",
    postData: dojo.toJson({
        foo: 'test',
        created_at: (new Date()).getTime()
    }),
    load: function(data, status) {
        console.log(status)
        if (status.xhr.status == 200 || status.xhr.status == 201) {
            console.log(true);
        }
    },
    error: function(error, status) {
        console.log(error);
    }
});

console.log(dojo.toJson({
        foo: 'test',
        created_at: (new Date()).getTime()
    }));