Code collection is a tool for collecting and running JavaScript scripts. It can help you quickly create and run scripts, and export and share them with your friends or colleagues.
Address: http://tanghuibo.github.io/code-collection
The script is divided into two parts, the parameter part and the method part
The parameters are in JSON array format and are used to generate forms for users to fill in. Each item has the following attributes.
parameter | effect |
---|---|
label | form tag |
key | Parameter key |
default | default value |
example:
[
{
"key" : " name " ,
"label" : "名称"
},
{
"key" : " sex " ,
"label" : "性别" ,
"default" : "男"
}
]
The generated form is:
The method is function function
function(param, print) {
.....
}
The first parameter is the form submitted by the user. Each item of the form is obtained through the parameter key.
The second parameter is the print function. The first parameter of the print function is the label of the printed value, and the second parameter is the printed value.
run
print ( "名称" , "冯宝宝" ) ;
have to
In addition to basic addition, deletion, modification and query, it also points out the import and export functions.
In order to prevent users from using the wrong script, it is recommended that:
Fill out the form and click Run~