This article describes how to use js to implement page forwarding. The specific implementation is as follows. If you are interested, you can refer to it and hope to help you with the following example:
The following code is used:
The Code is as follows:
Function forward ()
{
// Concatenate a string for the sent content and then send it.
Var temp = "";
Var array = new Array ();
$ ("# Yxdwlb tr"). each (function (){
Var flag = false;
Var user = "";
$ (This). find ("td"). each (function (n ){
If (n = 0 ){
// User = user + $ (this). find ("input"). is (": checked") + ",";
Flag = $ (this). find ("input"). is (": checked ");
}
If (n = 1) {user = user + this. innerText + ",";}
If (n = 2) {user = user + $ (this). find ("input"). val () + ",";}
If (n = 3) {user = user + $ (this). find ("input"). is (": checked") + ",";}
If (n = 4) {user = user + $ (this). find ("input"). is (": checked") + ";";}
}); // Column
If (flag = true ){
Array. push (user );
}
}); // Line
For (var I = 0; I {
Temp = temp + array [I]; // assemble the elements of the array into strings and save them to the temp variable,
}
$ ("# Array"). val (temp); // Save the temp variable to the parameter array
// Judge whether the description is not empty
Var description = jQuery ("# description"). val ();
If (trim (description) = ''){
Triman. alert ("Enter the description! ");
Return;
}
// Obtain and forward the Form Content
Var doc = document. getElementById ("document ");
Doc. action = "$ {pageContext. request. contextPath}/documentManager/save ";
Doc. method = "post ";
Doc. submit ();
}