As a front-end, you need to pass parameters to the background to test, but the background is not PHH and not JSP, is not familiar with their own short time can not grasp the language,
For testing convenience, if only simple parameters, non-data flow can be directly to the HTML page through the URL, the relevant code is as follows
<!doctype html>
<meta chareset= "Utf-8" >
<body>
<script>
var paramarr = [];
Gets an array of argument lists, each of which is an object {key: ', Val: '},key is the parameter name, Val is the argument value
function GetParameters () {
var params = Window.location.search;
var paramlist = params.substr (1). Split (' & ');
for (Var i=0;i<paramlist.length;i++) {
var paramkey = paramlist[i].split (' = ') [0];
var paramval = paramlist[i].split (' = ') [1];
var param = {};
Param.key = Paramkey;
Param.val = Paramval;
Paramarr.push (param);
}
return Paramarr;
}
Gets the parameter value corresponding to the specific parameter name
function Getparambyname (name) {
for (Var i=0;i<paramarr.length;i++) {
if (Paramarr[i].key ==name) {
return paramarr[i].val;
}
}
}
GetParameters ();
Here I test the parameter named code, please modify it yourself
Alert (Getparambyname ("Code"));
</script>
</body>
HTML5 Web page get URL pass parameters