Window.Open open a new form and use the Post method to pass the parameter

Source: Internet
Author: User

functionOpenpostwindow (url,data,name) {//URL to jump to the page, the data to be passed, the name of the new form name          varTempform = document.createelement ("form"); Tempform.id= "TempForm1"; Tempform.method= "POST"; Tempform.action=URL; Tempform.target=name; varHideinput = document.createelement ("Input"); Hideinput.type= "hidden"; Hideinput.name= "Dataname"Hideinput.value=data;             Tempform.appendchild (Hideinput); Tempform.attachevent ("OnSubmit",function() {Openwindow (name);});//The URL must not be used with name, otherwise it cannot be passed to a new pageDocument.body.appendChild (tempform); Tempform.fireevent ("OnSubmit");          Tempform.submit (); Document.body.removeChild (tempform);}functionOpenwindow (name) {variwidth=1100;//the width of the popup window;     variheight=550;//the height of the popup window;     varITop = (window.screen.availheight-30-iheight)/2; Get the vertical position of the window;varILeft = (window.screen.availwidth-10-iwidth)/2;             Get the horizontal position of the window; window.open (' About:blank ', name, "height=" +iheight+ ", width=" +iwidth+ ", top=" +itop+ ", left=" +ileft+ ", Toolbar=no, Menubar=no, Scrollbars=yes,resizable=yes,location=no, Status=no "); }  

In the new page: String data = (string) request.getparameter ("Dataname"); Gets the value passed in on the previous page

Window.Open open a new form and use the Post method to pass the parameter

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.