• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
a_a
Forget patterns, embrace creative.
            管理     

什么是JSON——Atlas中的数据传输格式

在学习Atlas时已经N次看到JSON这个名词,今天特地查了一下。

原来JSON是一种用基于文本的数据描述格式,全称“JavaScript Object Notiation”,类似于XML和SOAP,同样具有跨平台的特性。

我举一个小例子,

先看看用Xml描述论坛中的帖子:

<posts>
<post>
<id>1</id>
<title>帖子1</title>
<content>内容</content>
<posterId>13</posterId>
</post>
<post>
<id>2</id>
<title>帖子2</title>
<content>内容</content>
<posterId>13</posterId>
</post>
</posts>

使用JSON:

{posts:[
{
id:1,
title:"帖子1",
content:"内容",
posterId:13
},
{
id:2,
title:"帖子2",
content:"内容",
posterId:13
}
]};

Atlas从Beta版开始全面用JSON格式描述服务器和客户端之间传输的数据,Microsoft.Web.Script.Services命名空间提供这方面的支持。

以下提供一点参考资料,仅供大家对JSON进行浅显的了解。

  1. 微软的Ajax道路:ASP.NET AJAX的JSON
  2. The AJAX response: XML, HTML, or JSON?
posted @ 2006-11-15 18:04  a_a  阅读(779)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3