createPopup method
[This documentation is preliminary and is subject to change.]
Creates a popup window object.
Syntax
var retval = window.createPopup(varArgIn);Standards information
There are no standards that apply here.
Parameters
- varArgIn [in, optional]
-
Type: VARIANT
This argument is reserved.
Return value
Type: ObjectReturns a popup window object.Remarks
The pop-up window is initially in a hidden state.
When an element has focus and causes a popup to appear, the element does not lose focus. Because of this, an onblur event associated with an element that creates a popup will not occur when the popup is displayed.
Note Documents that change the document.domain property before creating the popup object may receive an "Access is denied" error message when accessing the pop-up object. Changes made to document.domain in the calling document will not propagate to the new pop-up object; this is currently a design restriction to limit access with the pop-up object.
Windows Internet Explorer 8. Windows created with createPopup inherit the zoom state of windows that created them.
Windows Internet Explorer 7 and later. By default, windows created with the createPopup function are displayed in IE5 (Quirks) mode compatibility mode (also called "quirks" mode), regardless of the display mode of the webpage that created them. To display standards-based content in a popup window, use document.location location to load an external document into the popup window. When you do this, the popup window will render the content according to the document compatibility mode of the loaded content. For information, see Defining Document Compatibility.
Microsoft Internet Explorer 6 for Windows XP Service Pack 2 (SP2) places several restrictions on windows created with this method. Restricted properties include size, screen position, and z-order. For more information, see About Window Restrictions.
Examples
The following example shows how to use the createPopup method to create and display a pop-up window.
<HTML>
<HEAD>
<TITLE>Popup Example</TITLE>
<SCRIPT LANGUAGE="JScript">
var oPopup = window.createPopup();
function ButtonClick()
{
var oPopBody = oPopup.document.body;
oPopBody.style.backgroundColor = "lightyellow";
oPopBody.style.border = "solid black 1px";
oPopBody.innerHTML = "Click outside <B>popup</B> to close.";
oPopup.show(100, 100, 180, 25, document.body);
}
</SCRIPT>
</HEAD>
<BODY>
<BUTTON onclick="ButtonClick()">Click Me!</BUTTON>
</BODY>
</HTML>
See also
Build date: 3/8/2012
- 10/18/2011
- Robin E Davies
1. Although popup does-not pull focus, it does clear the edit-buffer (ie. Ctrl-Z/-Y lose it).
2. Although popup does-not pull focus, Escape from a popup loses the blinking-cursor. [*]
3. Although no navigation can be done inside the popup, it still uses 'parent.' references.
4. When though the Contextmenu -key- invokes a popup, there is no key-navigation within.
5. A popup invoked from another popup, loses variable-references' assumed-definition.
6. Popups interfere with onmousemove, causing spurious 100-1000/sec. blocking scrollbar....
[Discovered in contenteditable mode]
- 9/19/2008
- Mr. Raymond Kenneth Petry
- 12/24/2008
- Mr. Raymond Kenneth Petry