inotgo.com


Tool version compatibility problem
JSON JavaScript Object representation ( Java Script Object Notation) Is a way to store data .
Correct

Example 1 : establish JSON Object   
Example 2 : visit JSON Object   

var gareen = {"name":" Galen ","hp":616};
This creates a JSON Object
JSON The object consists of name / Value pair form Use a colon between the name and the value : separate
The name must use Double quotes " Include
The value can be any javascript Data type , character string , Bull , Numbers , Arrays and even objects
different name / Value pair Between comma , separate
Operation effect
<script> var gareen = {"name":" Galen ","hp":616}; document.write(" This is a JSON Object : "+gareen); </script>
<script>
var gareen = {"name":" Galen ","hp":616};
 
document.write(" This is a JSON Object : "+gareen);

</script>


Source code
1. Double click the selected word 2. Triple Click to select the entire row 3. CTRL+F Find 4. F8 Full screen editing , Click restore again
Rendering Rendering complete
effect
Through Point . visit JSON Object properties
Operation effect
<script> var gareen = {"name":" Galen ","hp":616}; document.write(" Hero name : " + gareen.name + "<br>"); document.write(" Hero's HP : " + gareen.hp + "<br>"); </script>
<script>
var gareen = {"name":" Galen ","hp":616};

document.write(" Hero name : " + gareen.name + "<br>");
document.write(" Hero's HP : " + gareen.hp + "<br>");
</script>


Source code
1. Double click the selected word 2. Triple Click to select the entire row 3. CTRL+F Find 4. F8 Full screen editing , Click restore again
Rendering Rendering complete
effect


The official account of programming , Follow and get the latest tutorials and promotions in real time , thank you .


Q & A area    
2019-03-08 struts return json Format Your data ... How do you do it?
deep_ocean

Check the database in the background Store the data in a list Inside . If you want to call the foreground, the background data is json Format . How do you do it? ..




1 One answer

h545466093
Answer time :2021-09-19



The answer has been submitted successfully , Auditing . Please My answer Check the answer record at , thank you
answer Or code please Fill in at least one , If you have a problem , Please ask again , Otherwise, the webmaster may not see




2018-04-26 How to send the data from the back end json The format string array is converted to the table display at the front end
67

For example, a string comes from the back end Json, The front end gets the string object , How to use object matching Json The key value pair of the string




4 One answer

I will study hard JAVA of
Answer time :2019-06-13
This depends on what framework you use in the front end , For example, I use MiniUI Only a collection of objects , Turn to json To the front end , The front end will automatically parse , Load into table , notice All you need is row by row data ,

Beehow2J
Answer time :2018-12-18
I use it directly websocket Connected to the backstage manager , Then, the background data changes or how often to actively push the data to the foreground through a long connection (json Format ), Then the front desk can refresh the display

Life has dreams, each wonderful
Answer time :2018-12-10
<script> jarr = eval(jarr); for (var i = 0; i < jarr.length; i++) { id = jarr[i].id; name = jarr[i].name; sex = jarr[i].sex document.write(name+"----"+id+"----"+sex+"<br>"); } </script>

Skinny pig
Answer time :2018-12-06
From the back end json Put it in session in , Then the front desk can according to this session To traverse the data



The answer has been submitted successfully , Auditing . Please My answer Check the answer record at , thank you
answer Or code please Fill in at least one , If you have a problem , Please ask again , Otherwise, the webmaster may not see




2017-09-19 JSON visit
2017-08-21 Excuse me? : Example 1 Why is one of the results shown in object, One is Object?
2016-11-22 Why, this JSON Objects are created in the same way as js Like objects , The same is true of access




Please... Before asking questions land
The question has been submitted successfully , Auditing . Please My question Check the question record at , thank you
about Front end part -JSON-Hello JSON Your questions

Try to provide Screenshot code and Abnormal information , Help to analyze and solve problems . You can also enter this station QQ Group communication : 496725845
Ask questions and try to provide complete code , Environment description , The more conducive to the recurrence of the problem , The faster your question can be answered .
Have questions about the code in the tutorial , Please provide which step , Which line is in doubt , This makes it easy to quickly locate the problem , Improve the speed at which questions are answered
In the thousands of questions that already exist , A considerable proportion , Because of the use of and webmaster Different versions of the development environment Resulting in , For example jdk, eclpise, idea, mysql,tomcat Wait, the version of the software is inconsistent .
Please use the same version as the webmaster , You can save yourself a lot of learning time . The webmaster sorted out the software versions used in teaching , It's all here , Convenient for everyone to download : /k/helloworld/helloworld-version/1718.html

Upload screenshot