Practical JS summary 1-Form

Source: Internet
Author: User
In the past two weeks, due to project requirements, I had to work on JS intermittently for a while. finally, from the blank to the present, at least basic achievements will be achieved... there is still some relief in addition to tossing.
Now I will post a small summary of my frequently-used documents and make a transcript for myself so that I can learn more ....

1. Open a new form:

Mode dialog box to open a subform

 

Function openchild () {

Window. showmodaldialog ("/Chatroom/pages/main.htm", Window,"Dialogwidth: 610px; Status: No; dialogheight: 700px");

}  

Specified ument. Location = URL}

Function closethewindow ()
{

VaR P = Window. dialogarguments;
P. Location = P. location;
Window. Close ();
}

Window. Open open a new form:

1   This . Page. clientscript. registerstartupscript ( This . GetType (), "" , " <SCRIPT> window. open ('/chatroom/pages/orgtreeview. aspx ', '', 'scrollbars = Yes, toolbar = No, location = No, direction = No, width = 250, Height = 500, Top =' + (window. screen. height-500)/2 + ', Right =' + (window. screen. width-300)/2); </SCRIPT> " );

In this way, close the child form and refresh the parent form.


  String URL =   " Permission. aspx " ;
This . Page. clientscript. registerstartupscript ( This . GetType (), "" , " <SCRIPT> alert('permission allocation successful '{}opener.doc ument. Location =' "   + URL +   " '; Window. Close () </SCRIPT> " );

The specific parameters are described as follows:

1 Function openwin (URL) {
2 Window. Open (URL, "newwindow", "height" = 300 , Width = 400 , Top = 200 , Left = 200 Toolbar = No, menubar = No, scrollbars = No, resizable = No, location = No, status = No ")
3 }
4 Parameter description: window. open is the command to open a new window. The parameter URL is used to input the page to be opened;
5
6 Newwindow is optional;
7
8 Height indicates the height of the window;
9
10 Width indicates the window opening width;
11
12 Top is the number of rows from the window to the top of the display;
13
14 Left is the number of rows from the window to the left of the display;
15
16 Toolbar: sets whether to display the toolbar;
17
18 Menubar sets whether to display the menu bar;
19
20 Scrollbars sets whether to display the scroll bar;
21
22 Whether the resizable value can be adjusted;
23
24 Location: Specifies whether to display the address bar;
25
26 Status indicates whether the status bar is displayed;
27

 

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.