window.open passing parameters via "post" in JS

Source: Internet
Author: User

in JS, the steps for passing parameters via "post" are as follows: window.open

such as: In the a.jsp has a JS method Winow.open, the target address is xx.do

1, build a form in a.jsp, the value to be set by JS Dynamic Add to the inside, such as:

$ ("#postForm"). Append (' <input type= "hidden" name= "query.id" value= ""/> ");
2. Set the target property of the form:
$ ("#postForm"). attr ("Target", "Newwin");
3. Set the action of the form:
$ ("#postForm"). attr ("Action", "<%=path%>/xx/xx.do");
4, window.open:
window.open ("About:blank", "Newwin", "" ");//newwin is the target of the form above
5. Submit the form:
$ ("#postForm"). Submit ();

OK, after completing the above 5 steps, the complete JS method is as follows:

function Openwin () {   $ ("#postForm"). HTML (");//prevents elements from repeating   $ (" #postForm "). Append (' <input type= ' hidden ' name= "Query.id" value= "/>");   $ ("#postForm"). attr ("Target", "Newwin");   $ ("#postForm"). attr ("Action", "<%=path%>/xx/xx.do");   window.open ("About:blank", "Newwin", "" ");//newwin is the target   $ (" #postForm ") of the form above. Submit ();

reprinted from : http://www.thinksaas.cn/news/show/431/

window.open passing parameters via "post" in JS

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.