Javascript code-javascript

Source: Internet
Author: User
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 ();
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.