Page Pass Value Tips
Usually we do in the Web project, generally an HTML page will have several steps, Step_num①,step_num②,step_num③, generally first show Step_num①, according to the jump condition display Step_num②,step_num① hidden, Then jump Step_num③,step_num①,step_num② hidden, Step_num③ display.
Idea: (JS sets the global variable, where to add a input tag, assign the value to an input, and then let input hide).
First of all, I do the structure of the page, into the xxx.html page, through the JS send Ajax.postform request, request a action,action call handler, each function to request an action.
The first two days to do is such a page, and then in the value of the time encountered a human brain pain problem, need to show in Step_num① and not show the value, to step_num③ corresponding to the background Java code, I am also drunk, tried several methods are not good use, and finally, With a little trick.
In JS, first set a global variable, such as Var groupid= ""; , and then the Step_num① from the background action from the GroupID assigned to GroupID, how to pass the page three corresponding Java background it?
Now step_num③ the corresponding HTML code to write such a statement: <input id= "Chuanzhi" name= "Chuanzhi" type= "hidden"/>
Then put $ ("#chuanzhi") in the corresponding JS code. val (GroupID);
This way you can go through Request.getparameter ("Chuanzhi") in the Step_num③ corresponding Java background, and get the groupid you want.
Tips for Html5+js page values to Java background