认识JSON
2016-02-23 06:59
435 查看
What is JSON?
Why does JSON matter?
How do we use JSON in a project?
We'll also use our newfound skills with JSON at the end of
this project to build a quick app that loads photos from Flickr without
requiring a page refresh.What Is JSON?
JSON is short for JavaScript Object Notation, and is a way to store information in
an organized, easy-to-access manner. In a nutshell, it gives us a
human-readable collection of data that we can access in a really logical
manner.
Why Does JSON Matter?
With the rise of AJAX-powered sites, it's
becoming more and more important for sites to be able to load data quickly and asynchronously,
or in the background without delaying page rendering. Switching up the contents
of a certain element within our layouts without requiring a page refresh adds a
"wow" factor to our applications, not to mention the added
convenience for our users. Because of the popularity and ease of social media,
many sites rely on the content provided by sites such as Twitter, Flickr, and
others. These sites provide RSS feeds, which are easy to import and use on the
server-side, but if we try to load them with AJAX, we run into a wall: we can
only load an RSS feed if we're requesting it from the same domain it's hosted
on.
JSON allows us to overcome the cross-domain issue because we
can use a method called JSONPthat uses a callback function to send the JSON data back to our domain. It's
this capability that makes JSON so incredibly useful, as it opens up a lot of
doors that were previously difficult to work around.
http://www.copterlabs.com/json-what-it-is-how-it-works-how-to-use-it/
Why does JSON matter?
How do we use JSON in a project?
We'll also use our newfound skills with JSON at the end of
this project to build a quick app that loads photos from Flickr without
requiring a page refresh.What Is JSON?
JSON is short for JavaScript Object Notation, and is a way to store information in
an organized, easy-to-access manner. In a nutshell, it gives us a
human-readable collection of data that we can access in a really logical
manner.
Why Does JSON Matter?
With the rise of AJAX-powered sites, it's
becoming more and more important for sites to be able to load data quickly and asynchronously,
or in the background without delaying page rendering. Switching up the contents
of a certain element within our layouts without requiring a page refresh adds a
"wow" factor to our applications, not to mention the added
convenience for our users. Because of the popularity and ease of social media,
many sites rely on the content provided by sites such as Twitter, Flickr, and
others. These sites provide RSS feeds, which are easy to import and use on the
server-side, but if we try to load them with AJAX, we run into a wall: we can
only load an RSS feed if we're requesting it from the same domain it's hosted
on.
JSON allows us to overcome the cross-domain issue because we
can use a method called JSONPthat uses a callback function to send the JSON data back to our domain. It's
this capability that makes JSON so incredibly useful, as it opens up a lot of
doors that were previously difficult to work around.
http://www.copterlabs.com/json-what-it-is-how-it-works-how-to-use-it/
相关文章推荐
- json字符串和json对象异同和互相转换
- 【js】selector值改变时显示当前选中option值
- HTML一个form表单中有两个(多个)submit,后台如何区分(纯HTML实现,无需javascript)
- JS特殊函数(Function()构造函数、函数直接量)的区别
- 简单的JsTree 树形视图 checkbox demo
- Javascript技术栈中的四种依赖注入详解
- JavaScript tab选项卡插件实例代码
- javascript每日必学之封装
- 学习Javascript面向对象编程之封装
- 理解javascript封装
- JS实现的仿QQ空间图片弹出效果代码
- javascript每日必学之继承
- javascript每日必学之多态
- 理解javascript定时器中的单线程
- JavaScript添加随滚动条滚动窗体的方法
- JavaScript简单实现鼠标移动切换图片的方法
- Web开发必知Javascript技巧大全
- 理解javascript定时器中的setTimeout与setInterval
- javascript瀑布流式图片懒加载实例
- javascript瀑布流式图片懒加载实例解析与优化