SAJAX死了吗?用什么代替? [英] Is SAJAX dead? What to replace with?

查看:50
本文介绍了SAJAX死了吗?用什么代替?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用Sajax向站点添加小的Ajax代码.在遇到问题并进行了一些挖掘之后,该库似乎自2005年以来就没有进行过更新.

We use Sajax for adding small Ajax code to sites. After running into a problem and doing some digging, it seems the library hasn't been updated since 2005.

我非常感谢Sajax轻巧,易于使用和易于安装(只需在PHP中包含文件).

I've appreciated Sajax for being lightweight, easy to use, and easy to install (just include the file in PHP).

因此,在LAMP堆栈上,如果您以前使用过Sajax,您将升级到什么?易于使用是关键,因为一些半程序员的Web开发人员也使用该代码.

So, on the LAMP stack, if you have used Sajax before, what would you upgrade to? Ease of use is key since some semi-programmer web developers use the code too.

我知道很多人会说jQuery,但这和Sajax一样简单吗?

I know a lot of people would say jQuery, but is that as simple as Sajax?

推荐答案

我会说使用

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 是一个很棒的工具,其中包含许多示例插件允许您执行一些很棒的东西!

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

这篇关于SAJAX死了吗?用什么代替?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆