New Ideas for displaying web page data (json) _ json
Source: Internet
Author: User
If json is used as the data exchange format between the client and the server, the original html exchange format is replaced. When the client uses js to bind json data to page elements, the server only generates json strings of different data based on parameters, which not only reduces network data traffic, the display layer and logic layer are also separated.
To bind data, the client must have the js Code used to bind data. Data Binding is usually the same, so public binding methods can be used. For example, span binds data to html attributes.
Advantages:
1. A small amount of data exchange is conducive to transmission.
2. Separation of the page and Business Layer
3. No refreshing data binding
4. the load on the server is reduced because the amount of data to be generated is reduced.
Disadvantages:
1. Client pressure increases due to the use of js to bind data
2. JavaScript code incompatibility may occur due to different browsers, and Data Binding may fail (severe) (this defect can be remedied if the user can add the extended binding method)
3. the surface structure of the website is easy to be exposed to people (the security work to be done may be increased)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service