原文来自:http://hpyer.cn/visit-remote-data-with-jsonp-in-javascript.html
一、基础知识
1、什么是 JSON:JavaScript Object Notation (JSON) 是一种轻量级、基于文本、语言无关的数据交换格式。它是从 ECMAScript 语言标准衍生而来的。JSON为轻便的表示结构化数据,定义了一小套格式化规则。以下是一个 JSON 对象的例子:
{
"Image": {
"Width": 450,
"Height": 561,
"Title": "Intel Core 2 Duo",
"Thumbnail": {
"Url": "http://www.example.com/image/...",
"Height": 125,
"Width": "100"
},
"IDs": [116, 943, 234, 38793]
}
}
2、什么是 JSONP:JSONP(JSON with Padding)是一个非官方的协议,它允许在服务器端集成 Script tags 返回至客户端,通过 Javascript callback 的形式实现跨域访问(这仅仅是 JSONP 简单的实现形式)。
阅读全文…

1 Comment