Beginners ask a few questions about json objects

Why use json object strings here, as shown in the figure? Then the front-end js parses the string into an object with JSON.parse (), so why not just use the normal js object form in the first place?


data transmission is generally in the form of strings


front and rear are different languages, and they all support the processing of data in json format. That's why it is used in this way, which is more convenient for data transmission and processing between different languages.


this backend obviously does not know how to use the json_encode function. However, after json_encode, there is indeed a string
. Just take a look at the http protocol. The data is transferred using the string

.
Menu