开发者

Using JSON and Ajax together

I 开发者_开发技巧have never used Ajax with JSON. Are there any good resources to look upon?


Think of Ajax as a way to send and receive textual content with the server. The format of the messages you send back and forth is up to you. You could use JSON, XML, YAML, CSV, or whatever else you want.

If you separate these two concerns your problem should be a lot easier to approach.

  1. Figure out how to make an Ajax call to your server
  2. Figure out how to parse and serialize JSON

If you use a JavaScript framework, like jQuery or Prototype, both of these things will be handled for you pretty seamlessly with their Ajax APIs.

  • http://api.jquery.com/jQuery.ajax/
  • http://www.prototypejs.org/api/ajax/request
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜