Web Gadget SDK Web Gadget SDK
[Back to Web Gadget SDK Index]
This API reference will provide information about global objects, classes, methods and properties that are available on the Windows Live Gadget platform.
Windows Live Gadget API Reference
Global Objects
Object Description
M_CultureVariable_Text Deprecated. Use module.getLocale(), module.getLanguage(), or module.getMarket() instead. 
Classes
Classes Description
Module An instance of the Module object is created for each Gadget. The Module object that can be used to access various UI elements and settings that are specific to the Gadget.
Web.Bindings Provides methods to programmatically bind elements and selectors to a web binding.
Web.Browser Provides methods to query for the web browser type and version.
Web.Enum Class used to define enumeration objects.
Web.Event Class used to define events for bindings.
Web.Flags Class used to define flag objects. A flag object is an enumeration of name/value pairs.
Web.Network Provides methods to create network proxied network requests so that cross-domain calls can be made.
Web.StringBuilder Provides an efficient approach to concatenating strings.
Module Class
Summary
An instance of the Module object is created for each Gadget. The Module object that can be used to access various UI elements and settings that are specific to the Gadget.
Methods

Method Description
deletePreference Removes a setting object that was previously set by the setPreference method.
getEl Returns the DOM element object that contains the Gadget.
getFooterEl Inline Gadgets only. Returns the DOM element object that contains the footer of the Gadget.
getId Returns the ID of the <div> element associated with the Gadget.
getLanguage Returns a string that represents the current language used.
getLink Returns the URL associated with the Gadget title.
getLocale Returns a string that represents the current locale used.
getMarket Returns a string that represents the current market used.
getMode Returns the mode of the gadget – author or viewer
getPreference Returns a setting object previously stored via the setPreference method.
getTitle Returns the title of the gadget.
resize Resizes the Gadget based on the current context so that the contents fit within the Gadget body.
resolveUrl Resolves a relative URL with the location of the manifest URL as the base location. Returns a string containing the resolved absolute URL.
setFooterText Inline Gadgets only. Sets the footer text of the Gadget.
setPreference Sets a setting object that can be later retrieved using the getPreference method.
setTitleIcon Inline Gadgets only. Sets the icon used in the title bar of Gadget.
setTitleLink Inline Gadgets only. Sets the URL associated with the title of the Gadget.
setTitleText Inline Gadgets only. Sets the text used in the title bar of Gadget.
Web.Bindings Class
Summary
Provides methods to programmatically bind elements and selectors to a web binding.
Methods

Method Description
attachElementBindingSync Attaches a binding directly to an element. You should use this version of the method if the binding definitions are already included on the page.
attachEvent Attaches an event handler to an event of the Binding object.
attachSelectorBindingSync Attaches a binding via a CSS Selector synchronously. This method should be used if the binding definitions are already included on the page.
detachEvent Detaches an event handler from the Binding's event.
fire Fires an event defined by the Binding object.
Web.Browser Class
Summary
Provides methods to query for the web browser type and version.
Methods

Method Description
isIE Returns whether the web browser in use  is Internet Explorer.
isMozilla Returns whether the web browser in use is Mozilla.
isOpera Returns whether the web browser in use is Opera.
Web.Enum Class
Summary
Class used to define enumerations.
Methods

Method Description
create Creates and returns an enumeration object.
getValues Used to enumerate the values in an enumeration object. 
Web.Event Class
Summary
Class used to define events for bindings.
Methods

Method Description
create Creates an event enumeration. Use this method to define events for your binding.
Web.Flags Class
Summary
Class used to define flag objects. A flag object is an enumeration of name/value pairs.
Methods

Method Description
create Creates and returns a flag object.
Web.Network Class
Summary
Provides methods to create network proxied network requests so that cross-domain calls can be made.
Methods

Method Description
createRequest Creates and returns a network request object. The returned network request object can then be executed to issue the network request.
createBatch Creates and returns a batch network request object. The returned batch network request object can then be executed to issue the batch network requests.
Web.StringBuilder Class
Summary
Provides an efficient approach to concatenating strings.
Methods

Method Description
append Appends the specified string to the StringBuilder object.
appendLine Appends the specified string and a carriage return to the StringBuilder object.
clear Clears the string value contained in the StringBuilder object.
isEmpty Checks to see if the string value contained in the StringBuilder object is empty.
toString Returns the string value contained in the StringBuilder object.