Share via


System.Gadget.document Property

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

This property is read-only.

Syntax

propVal = System.Gadget.document()

  

Parameters

  • oDocument [out]
    Retrieves the gadget DOM.

Remarks

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.

Examples

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>
</div>
</body>

The gadget Flyout HTML file.

<body>
<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);" />
</div>
</body>

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;
}

Requirements

Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
IDL Sidebar.idl
DLL Sidebar.Exe version 1.00 or later

See Also

System.Gadget

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK