何时使用Ajax VS Json用来JavaScript事件?事件、VS、Ajax、JavaScript

由网友(若即若離ヤ)分享简介:我不那么熟悉的Ajax,但我不断听到的Json提到的某种竞争性选项。是否有当使用一个与其他的规则?I'm not so familiar with Ajax but I keep hearing Json mentioned as some kind of competing option. Is there a r...

我不那么熟悉的Ajax,但我不断听到的Json提到的某种竞争性选项。是否有当使用一个与其他的规则?

I'm not so familiar with Ajax but I keep hearing Json mentioned as some kind of competing option. Is there a rule for when to use one versus the other?

我想处理JavaScript事件在我的应用程序和应用程序动态更新的前端,但我不知道我是否需要使用Ajax或JSON这一点。

I'd like to process Javascript events in my app and update the front-end dynamically from the app but I'm not sure whether I need to use Ajax or Json for this.

推荐答案

下面是一些JSON的:

Here's some JSON:

{ "taco" : "awesome", "burrito": "less awesome", "fishTaco": "1000" }

看起来pretty的很像在这种情况下的阵列

Looks pretty much like an array in this case.

你也可以使用AJAX来获取JSON。我用它经常回表数据。您可能已经使用的类JSON数据,你的JavaScript,但并没有意识到这一点。

And you can use AJAX to get the JSON. I use it to return table data often. You've probably already used JSON-like data in your javascript but didn't realize it.

我preFER请求JSON数据,而不是XML或HTML。我觉得更容易对付比XML,以及更灵活的比HTML。

I prefer to request JSON data rather than XML or HTML. I find it easier to deal with than XML, and more flexible than HTML.

阅读全文

相关推荐

最新文章