When I was a beginner in JSP, I was dizzy with the value transfer problem. After I checked some information, I finally got quite open. It turned out to be so simple.
To sum up, in. JSP click to open a new window B. JSP, and pass the value of a text box in A to B. The passing of this value should be the most basic. If you add B. the processing result in JSP is returned to. JSP, what about it? Alas,Simple. Currently, only three methods are available:
1.
Function check () {
var id = f1.userid. value;
window. open ("checkuserid. JSP? Userid = "+ id);
}< br> checkuserid. value in JSP:
<% string userid = request. getparameter ("userid"); %>
Ii. <a href = "javascript:;" onclick = "javascript: window. Open ('checkuserid. jsp? Userid = '+ f1.userid. Value) "> check the user name </a>
Iii. <input name = "button" type = "button" onclick = "javascript: window. Open ('checkuserid. jsp? Userid = '+ document. getelementbyid ('userid'). Value) "value =" whether the user exists "style =" background-color: # ffcccc; color: #339966 "/>
In fact, all of them are similar. The third one makes me depressed and I always don't know the format.