On the login page of our project, a pop-up window is opened to open the main homepage. Here, the pop-up window will be blocked by IE, we cannot prevent all clients from allowing a pop-up window by default, but we can give user related prompts. The following code is from the project logon page: Function openmain () { /* The URL is the path of the main window */ VaR url = "Main. Do "; /* Winparms indicates some property settings for window opening */ VaR winparms = "Height =" + (window. Screen. availheight-47) + ","; Winparms + = "width =" + (window. Screen. availwidth-13) + ","; Winparms + = "Left = 0 ,"; Winparms + = "Top = 0 ,"; Winparms + = "status = Yes, toolbar = No, menubar = No, location = No, resizable = Yes, scrollbars = Yes ,"; /* Omodal is used to monitor whether the pop-up window is blocked by IE */ VaR omodal = Window. Open (URL, "_ blank", winparms ); // When omodal = undefined, the IE pop-up window is blocked. // Conjecture: the principle of IE blocking should be that if a window is opened, the window is closed immediately. Therefore, omodal is undefined. If (omodal! = Undefined) { // If the window is successfully opened, the login window is closed, so that opener is null. When close is called, no message is displayed indicating whether to close the window. Window. Opener = NULL; Window. Close (); } Else { Alert ("your IE stops the pop-up window. In order to be able to use the system normally, please allow the pop-up window on this site! Thank you! "); } } |