WinJS.Utilities.ready function

Applies to Windows and Windows Phone

Ensures that the specified function executes only after the DOMContentLoaded event has fired for the current page. The DOMContentLoaded event occurs after the page has been parsed but before all the resources are loaded.

Syntax


WinJS.Utilities.ready(callback, async).done( /* Your success and error handlers */ );

Parameters

callback

Type: Function

A function that executes after the DOMContentLoaded event has occurred.

async

Type:

If true, the callback should be executed asynchronously.

Return value

Type: Promise

A promise that completes after the DOMContentLoaded event has occurred.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.Utilities

Library

Base.js

 

 

Show:
© 2014 Microsoft