Is SAJAX dead? What to replace with?

I would say it is easier to use jQuery.ajax:

$.ajax({
    type: 'GET',
    url: './example.json',
    dataType: 'json'
}).done(function (data) {
    // Use data...
});

$.getJSON('./some.php', { q: 'thing' }).done(function (data) {
    // Use data...
});

$.ajax({
    type: 'POST',
    url: './api.php',
    data: {
        action: 'save',
        info: APP.getInfo(),
        token: APP.getToken()
    }
});

jQuery is a great tool with lots of examples and plugins that allow you to do some pretty amazing things!

Leave a Comment