Home > Web Front-end > JS Tutorial > json's foreground operation and background operation implementation code_json

json's foreground operation and background operation implementation code_json

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:56:47
Original
1262 people have browsed it

The example is as follows:

Copy code The code is as follows:


< body>

Create object from JSON string



First Name: < ;br />
Last Name:






Then this time the application is to store data in json in the front page, Then send it to the background.
Attached is an application picture:
json's foreground operation and background operation implementation code_json
As can be seen from the picture, ModifyCellStyle is responsible for the style part of the font, but it cannot control alignment such as center, left, right, top, and center alignment. .ModifyString is to modify the content in the cell.
The format is as follows:
Copy the code The code is as follows:

var arrObj = []; //Action
Var act =
{"action":"ModifyCellStyle","bold":"true","italic":"false","cellIndex" :rowx ":" rowy};
arrObj.push(act); });
var sObj = JSON.stringify(arrObj);

Convert json into an array.
Take the ModifyCellStyle method as an example: the values ​​of bold, italic, and underline are Boolean values. That is, it can be true or false. The value of other sizeString, textColorString, cellColorString, etc. is string, and the value of cellIndex is "x, y", which are the abscissa and ordinate.
This API is mainly used in excel for cell operations. Record its historical operations. When you click save, the json-converted String is then sent to the background, where the data is received and excel is operated from the background.
Of course this requires loading the json2.js file. You can download it yourself
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Backslash present in Json
From 1970-01-01 08:00:00
0
0
0
mysql storage json error
From 1970-01-01 08:00:00
0
0
0
javascript - Problems with displaying json data
From 1970-01-01 08:00:00
0
0
0
php json conversion
From 1970-01-01 08:00:00
0
0
0
php - How should swagger return json comments?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template