Export (0) Print
Expand All
1 out of 4 rated this helpful - Rate this topic

System.Gadget.document property

[The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]

Gets an object that represents the Document Object Model (DOM) of the gadget HTML file.

This property is read-only.


objdocument = System.Gadget.document

Property value

An Object that receives the gadget DOM.


Equivalent to the JavaScript object.

Facilitates interaction between the main gadget window and a gadget Flyout by providing the ability to modify the other window's DOM and trigger events.


The following example demonstrates how to use the document object to update the gadget DOM from a gadget Flyout.

The gadget HTML file.

<body onload="Init();">
<g:background id="imgBackground" src="url(images/background.png)" />
<div id="gadgetContent">
<a id="aFlyout" href="javascript:void(0);" onclick="showFlyout();">Show Flyout</a><br />
<span id="sFlyoutFeedback"></span>

The gadget Flyout HTML file.

<g:background id="imgBackground" src="url(images/background.png)" />
<div id="flyoutContent">
<a href="javascript:void(0);" onclick="hideFlyout();">Hide Flyout</a><br />
<input type="text" id="txtFeedback" onkeyup="showInGadget(this);" />

The gadget Flyout script file.

var oGadgetDocument = System.Gadget.document;

// --------------------------------------------------------------------
// Hide the flyout.
// --------------------------------------------------------------------
function hideFlyout()
    System.Gadget.Flyout.show = false;

// --------------------------------------------------------------------
// Display the Flyout user input in the gadget.
// --------------------------------------------------------------------
function showInGadget(userInput)
    oGadgetDocument.getElementById("sFlyoutFeedback").innerText = userInput.value;


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

End of client support

Windows 7

End of server support

Windows Server 2008




Sidebar.Exe (version 1.00 or later)



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.