Javascript simulates post submission to hide the parameters in the address bar, including javascriptpost

Source: Internet
Author: User

Javascript simulates post submission to hide the parameters in the address bar, including javascriptpost

Simulate post submission using js

1: The request requires too long parameters, exceeding the maximum length allowed by get
2: To Hide parameters in the address bar

// Create a new form document. write ('<form name = myForm> </form>'); var myForm = document. forms ['myform']; myForm. action = 'runempattendance '; myForm. method = 'post'; var input = document. createElement ('input'); input. type = 'text'; input. name = 'userid'; input. value = 100; myForm. appendChild (input); myForm. submit (); // use an existing form in jsp to add other parameters var myForm = document. forms ['listemployee']; // form namevar input = document. createElement ('input'); input. type = 'ddn'; input. name = 'currentpage'; input. value = 1; myForm. appendChild (input); myForm. method = 'post'; myForm. submit ();


How to input javascript in the address bar to post specific content to the webpage?

The description is not detailed enough. However, I feel that your requirements can be fully implemented in the chrome console.

Use javascript to submit a POST

Ajax is not easy to implement and requires flash Support.
We recommend that you use the hidden iframe for submission.
<Iframe id = "a" name = "a" src = "blank.html" frameborder = "0" width = "0" height = "0" style = "display: none; "> </iframe>

<Form action = "upload. php" target = "a">
<Input type = "file" name = "file"/>
<Input type = "submit" value = "submit"/>
</Form>

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.