IFRAME and pop-up window summary

xiaoxiao2021-03-31  240

1. Open the window:

CODE:

Var Handle = Window.ShowModalDialog (URL, Objects, Feathers);

Where: Objects can be parameters (including arrays) or objects.

Usually usage Objects = {Window}, sharing the object of the parent form to the child form.

2. Close the sub-window:

CODE:

WINDOW.CLOSE ();

3. From the child form pass parameter to the parent window:

CODE:

WINDOW.RETURNVAL = String;

3. Clear the cache, prevent the mode window page from being updated:

CODE:

HTML

ASP

<%

Response.expires = -1

Response.expiresabsolute = now () - 1

Response.cachecontrol = "no-cache"

%>

PHP

Header ("Expires: MON, 26 JUL 1997 05:00:00 GMT");

Header ("Cache-Control: no-cache, must-revALIDATE");

Header ("prgma: no-cache";

JSP

Response.setHeader ("Pragma", "NO-Cache");

Response.setHeader ("cache-control", "no-cache");

Response.SetDateHeader ("Expires", 0);

4. Prevent open new windows (such as submitting form):

CODE:

5. Use the F5 refresh page in the mode window:

CODE:

reload ...

Where: FILENAME is a window page. 6. Preventing the Page Open Page Opening Cookie Loss: When the mode window opens a new window, you can only use ShowModalDialog (URL, Window, Feathers); method, and Objects is Window. 7. Narre any value for the main window in the pop-up window: Use: ShowModalDialog (URL, Window, Feathers) in the pop-up window (ie, the Window Object Collection of the main window), you can Gets or sets the value of the main window. Specific example:

Window.ShowModaldialog ('areaadd.jsp ", Window,' Dialogwidth: 245px; DialogHeight: 210px; Status: no; help: no; scroll: no; ');

Where the Window parameter must be required if you need the page between the page, otherwise it can be empty. This parameter also needs to communicate between the parent pages. The IFRAME name of the home page is Areaiframe, the sub-page name is areaadd, the parent page notification sub-page refresh: allaiframe.location.href = 'isaiframe.jsp'. Sub page Notification parent page refresh: window.dialogarguments.areasiFrame.areasreLoad (); where all, it is the JavaScript method in the sub-page

Note that iframe's properties must be accessed using the prefix Document.All, such as Document.all.Iframeid.MarginWidth.

转载请注明原文地址:https://www.9cbs.com/read-130982.html

New Post(0)