php – Is SAJAX dead? What to replace with?

php – 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!

Sounds a lot like xajax

php – Is SAJAX dead? What to replace with?

Correct me if Im wrong but Sajax is a PHP library and jQuery is a javascript library. Just felt like that distinction needs to be made.

At our company we use jQuery and I think its absolutely fantastic. Wouldnt trade it for anything else. But I would advise you to try any of the other many javascript libraries (Prototype, MooTools, YUI) and find out which one works for you.

Leave a Reply

Your email address will not be published.