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