This article is mainly to introduce you to the concept of json and what json can be used for. Friends in need can take a look.
First let’s take a look at What does json mean?
According to the explanation on Baidu Encyclopedia, we can know: JSON (JavaScript Object Notation, JS Object Notation) is a lightweight data exchange format. It is based on a subset of ECMAScript (the js specification developed by the European Computer Association) and uses a text format that is completely independent of programming languages to store and represent data. Simplicity and clear hierarchical structure make JSON an ideal data exchange language.
In fact, simply speaking, json is a data exchange format. So what is the data exchange format json used for? Let’s take a closer look below.
json is a data format that has the same function as an array and is used to store data.
For example, for a person's personal information, an array can be used to store it like this
var tom = ['Tom', '29', '170', 'man'];
If a rule is agreed upon, we can use such an array to save tom's information, namely name = tom[0 ], age = tom[1], height = [2], gender = tom[3]
But obviously this is not a good solution. We usually fill in data with tables. Know better
Name |
Age |
Height |
Gender |
Tom |
29 |
170 |
man |
Jake |
22 |
175 |
man |
So with json, use key-value mode to store data more intuitively
var tom = { name: 'tom', age: '29', stature: 170, gender: 'man' }
It is also very simple to access attributes. In the array we use The sequence index is used to access the specific value, while in json, key is used to access the value
For example, to access the age
var age = tom.age;
If there are many people, a combination of array and json will be used. Here is the code way to express the content of the above table
var data = [ { name: 'tom', age: '29', stature: 170, gender: 'man' }, { name: 'jake', age: '22', stature: 175, gender: 'man' } ]
In this table, I want to get jake’s height
var jakeSta = data[1].stature
The writing method of json mode is also called object literal in ECMAScript. It can not only simply To store values, you can also store functon
var test = { name: 'tom', function: getName() { return test.name; } }
json, which can also be used to transfer json data between the front and back ends. For example, the front end initiates a request and calls the interface, and the back end returns a string of json data, processes the data, and renders it on the page.
This article ends here. For more exciting content about json, you can pay attention to the php Chinese website! ! !
The above is the detailed content of What does json mean? What is it used for?. For more information, please follow other related articles on the PHP Chinese website!

1、先看看效果图,可以自行选择展示效果2、这是我在vue3项目中使用的JSON编辑器,首先引入第三方插件npminstalljson-editor-vue3yarnaddjson-editor-vue33、引入到项目中//导入模块importJsonEditorVuefrom'json-editor-vue3'//注册组件components:{JsonEditorVue},4、一般后端返回的是会将JSON转为String形式我们传给后端也是通过这种形式,就可以通

控制json序列化/反序列化1.@JsonIgnoreProperties的用法@JsonIgnoreProperties(value={"prop1","prop2"})用来修饰Pojo类,在序列化和反序列化的时候忽略指定的属性,可以忽略一个或多个属性.@JsonIgnoreProperties(ignoreUnknown=true)用来修饰Pojo类,在反序列化的时候忽略那些无法被设置的属性,包括无法在构造子设置和没有对应的setter方法.2.@Js

Java调用接口获取json数据保存到数据库1.在yml文件中配置自己定义的接口URL//自己定义的JSON接口URLblacklist_data_url:接口URL2.在Controller中添加请求方法和路径/***@Title:查询*@Description:查询车辆的记录*@Author:半度纳*@Date:2022/9/2717:33*/@GetMapping("/Blacklist")publicvoidselectBlacklist(){booleana=imB

本篇文章给大家带来了关于JWT的相关知识,其中主要介绍了什么是JWT?JWT的原理以及用法是什么?感兴趣的朋友,下面一起来看一下吧,希望对大家有帮助。

JSONSchemaJSONSchema是用于验证JSON数据结构的强大工具,Schema可以理解为模式或者规则。JsonSchema定义了一套词汇和规则,这套词汇和规则用来定义Json元数据,且元数据也是通过Json数据形式表达的。Json元数据定义了Json数据需要满足的规范,规范包括成员、结构、类型、约束等。JSONSchema就是json的格式描述、定义、模板,有了他就可以生成任何符合要求的json数据json-schema-validator在java中,对json数据格式的校验,使用

PHP作为一种常见的编程语言,在web开发中使用广泛,其与前端交互的方式也多种多样。其中,输出Json数据是一种常见的交互方式,但有时候会碰到Json无法解析的问题。为什么会出现无法解析的情况呢?下面列举了几个可能的原因。

当我们处理数据时经常会遇到将XML格式转换为JSON格式的需求。PHP有许多内置函数可以帮助我们执行这个操作。在本文中,我们将讨论将XML格式转换为JSON格式的不同方法。

一、@RestController注解在SpringBoot中的Controller中使用@RestController注解即可返回JSON格式的数据。@RestController注解包含了@Controller和@ResponseBody注解。@ResponseBody注解是将返回的数据结构转换为JSON格式。@Target({ElementType.TYPE})@Retention(RetentionPolicy.RUNTIME)@Documented@Controller@Respons


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download
The most popular open source editor
