WinJS.Application.start function

Applies to Windows and Windows Phone

Starts dispatching application events (the activated, checkpoint, error, loaded, ready, settings, and unload events).

Syntax


WinJS.Application.start();

Parameters

This method has no parameters.

Return value

This function does not return a value.

Examples

You can see how this function is used in the default.js file that is part of all the project templates for Visual StudioJavaScript applications. If you run this code, you will see "got loaded event", "got ready event", and "got activated event" in the JavaScript Console window in the Messages tab. If you comment out the call to app.start, none of the WinJS.Application events occur, and you will not see the lines in the JavaScript Console.


    // In default.js:

    . . .

    app.start();

    WinJS.Utilities.startLog("example");
    
    WinJS.Application.addEventListener("activated", function (ev) {
        WinJS.log && WinJS.log("got activated event", "example", "info");
    }, false);

    WinJS.Application.addEventListener("loaded", function (ev) {
        WinJS.log && WinJS.log("got loaded event", "example", "info");

    }, false);

    WinJS.Application.addEventListener("ready", function (ev) {
        WinJS.log && WinJS.log("got ready event", "example", "info");
    }, false);

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.Application

Library

Base.js

 

 

Show:
© 2014 Microsoft. All rights reserved.