Transfer value of WEB programming page

Source: Internet
Author: User
Document directory
  • HTML page value passing
HTML page value passing

Directly transfer values on a page, which can be implemented using a simple script. However, in many cases, we cannot just consider passing values. Not much nonsense,

The values in HTML are as follows:

For general integrity, the following code is used:

R. js

function sub(){var str=""+document.getElementById('area').value;var url="b.html?a="+escape(str);location.href=url;}

A.html and B .html

</Head> <SCRIPT type = "text/JavaScript" src = "R. JS "> </SCRIPT> <body> <textarea name =" area "id =" area "> </textarea> <a href =" ### "onclick =" sub () "> jump </a> </SCRIPT> </body>

B .html

<Body> <textarea name = "area" id = "area"> </textarea> <SCRIPT type = "text/JavaScript"> var loc = location. href; loc = Unescape (LOC); var n1 = loc. length; // The total length of the address var n2 = loc. indexof ("="); // obtain the = position if (N2> 0) {var id = loc. substr (n2 + 1, n1-n2); // The contents after the = Sign document. getelementbyid ("area "). value = ID ;}</SCRIPT> </body>

Transfer within page a.html

</Head> <SCRIPT type = "text/JavaScript" src = "R. JS "> </SCRIPT> <body> <textarea name =" area "id =" text "> </textarea> <textarea name =" area "id =" area "> </textarea> <a href = "####" onclick = "sub () "> jump </a> <SCRIPT type =" text/JavaScript "> var loc = location. href; loc = Unescape (LOC); var n1 = loc. length; // The total length of the address var n2 = loc. indexof ("="); // obtain the = position if (N2> 0) {var id = loc. substr (n2 + 1, n1-n2); // The contents after the = Sign document. getelementbyid ("text "). value = ID ;}</SCRIPT> </body>
 
r.js
function sub(){var str=""+document.getElementById('area').value;var url="b.html?a="+escape(str);location.href=url;}

 

 

 

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.