WinJS Namespace

The WinJS namespace provides special Windows Library for JavaScript functionality, including Promise and xhr. For more information, see Organizing your code with WinJS.Namespace.

The WinJS namespace has these types of members:

  • Objects
  • Properties
  • Functions

Objects

Object Description

ErrorFromName object

An error object.

Promise object

Provides a mechanism to schedule work to be done on a value that has not yet been computed. It is an abstraction for managing interactions with asynchronous APIs.

For more information about asynchronous programming, see Asynchronous programming. For more information about promises in JavaScript, see Asynchronous programming in JavaScript.

 

Properties

Property Description

validation property

Can be set to show the results of a validation process.

 

Functions

Function Description

define function

Defines a new namespace with the specified name. For more information, see Organizing your code with WinJS.Namespace.

defineWithParent function

Defines a new namespace with the specified name under the specified parent namespace. For more information, see Organizing your code with WinJS.Namespace.

log function

Writes output to the JavaScript console in Visual Studio. You can provide an implementation of this method yourself, or use WinJS.Utilities.startLog to log to the JavaScript console.

strictProcessing function

This method has been deprecated. Strict processing is always on; you don't have to call this method to turn it on.

xhr function

Wraps calls to XMLHttpRequest in a promise.

 

Requirements

Minimum WinJS version

WinJS 1.0

Namespace

WinJS

See also

Quickstart: Adding WinJS controls