Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
add
Expand Minimize

show method

Displays a pop-up window on the screen.

This method is not supported for Windows Store apps using JavaScript.

Syntax

var retval = popup.show(x, y, w, h, pElement);

Parameters

x [in]

Type: Integer

Integer that specifies the x-coordinate of the pop-up window, in pixels.
y [in]

Type: Integer

Integer that specifies the y-coordinate of the pop-up window, in pixels.
w [in]

Type: Integer

Integer that specifies the width of the pop-up window, in pixels.
h [in]

Type: Integer

Integer that specifies the height of the pop-up window, in pixels.
pElement [in, optional]

Type: Variant

Object that specifies the element to which the x andy coordinates are relative. If none is given, the x and y coordinates are relative to the desktop, where (0,0) is the upper left corner.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Standards information

There are no standards that apply here.

Remarks

A popup object is set to the same zoom level as the parent window.

Windows Internet Explorer 8. Pop-up windows zoom by default; this behavior cannot be changed. This only applies to pop-up windows created with createPopup.

Examples

The following example shows how to use the show method to create and display a pop-up window.


<html>
<head>
<script type="text/javascript">
var oPopup = window.createPopup();
function window_onload() {
    var oPopupBody = oPopup.document.body;
	oPopupBody.style.backgroundColor = "lightyellow";
	oPopupBody.style.border = "solid black 1px";    
    oPopupBody.innerHTML = "Display some <b>html</b> here.";
    oPopup.show(100, 100, 200, 50, document.body);}
</script>
</head>
<body onload="window_onload();">
</body>
</html> 

See also

popup
Reference
createPopup
hide
document
isOpen
Conceptual
Using the Popup Object

 

 

Show:
© 2015 Microsoft