JavaScript redirects the page and passes the message using the Post method

Source: Internet
Author: User

There are many ways to redirect pages in JavaScript, and there are many messages that can be delivered, but I only find two ways to pass the Post method.

The first method: use document.write
In the JavaScript function, use document.write ("<input type=" hidden "... >"), output several hidden,name on the page for the parameter name to pass, value for the argument to pass, and finally use " Document.formname.submit "Commit, FormName is the name of the form where hidden is located

The second method: Use hidden in the form
In the display form that you want to submit, such as:
<form name= "MyForm" >
<input type= "text" name= "Text1" size=10>
<%--omitted--%>
<input type= "text" name= "Textn" size=10>
<input type= "hidden" name= "Hidden1" >
<%--omitted--%>
<input type= "hidden" name= "Hidden1" >
<input type= "Submit" value= "OK" >
</form>

It is worth noting that adding the Reset button in the form above does not seem to reset the contents of hidden

JavaScript redirects the page and passes the message using the Post method

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.