In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-05-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the role of JavaScript JSON". In daily operation, I believe that many people have doubts about the role of JavaScript JSON. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about "what is the use of JavaScript JSON?" Next, please follow the editor to study!
JSON is the format used to store and transfer data.
JSON is usually used to transfer data from the server to a web page.
What is JSON?
The English full name of JSON is' JavaScript' 'Object'' Notation'.
JSON is a lightweight data exchange format.
JSON is an independent language.
JSON is easy to understand.
JSON uses JavaScript syntax, but the JSON format is just a text that can be read by any programming language and passed as a data format.
JSON is formatted as a JavaScript object:
The JSON format is syntactically the same as the code for creating JavaScript objects.
Because they are similar, JavaScript programs can easily convert JSON data into JavaScript objects.
JSON syntax rules:
The data is a key / value pair.
The data is separated by commas.
Curly braces save the object.
Square brackets hold the array.
JSON data:
A name corresponds to a value.
JSON data is formatted as key / value pairs, just like JavaScript object properties.
Http://www.iis7.com/a/lm/yczmljgj/
The key / value pair includes the field name (in double quotes), followed by a colon, followed by the value:
"name": "Runoob"
JSON object:
The JSON object is saved in curly braces.
As in JavaScript, an object can hold multiple key / value pairs:
{"name": "Runoob", "url": "www.runoob.com"}
JSON array:
The JSON array is kept in square brackets.
As in JavaScript, arrays can contain objects:
"sites": [
{"name": "Runoob", "url": "www.runoob.com"}
{"name": "Google", "url": "www.google.com"}
{"name": "Taobao", "url": "www.taobao.com"}
]
In the above example, the object "sites" is an array containing three objects.
Each object is the information of the site (site name and site address).
JSON.parse (): used to convert a JSON string to a JavaScript object.
JSON.stringify (): used to convert JavaScript values to JSON strings.
.
Javascript void
: void (0) meaning
We often use code like _ javascript:void (0), so what does _ javascript:void (0) mean in JavaScript?
The most critical word in _ javascript:void (0) is the void keyword, and void is a very important keyword in JavaScript, which specifies that an expression is "evaluated" but does not return a value.
The syntax format is as follows:
Differences between href= "#" and href= "_ javascript:void (0)":
# contains a location information, and the default anchor is # top, which is the top of the page.
On the other hand, _ javascript:void (0) simply represents a dead link.
When the page is very long, you will use # to locate the specific location of the page. The format is # + id.
If you want to define a dead link, use _ javascript:void (0).
At this point, the study on "what is the role of JavaScript JSON" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.