WinJS.Application.start function

16 out of 20 rated this helpful - Rate this topic

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 Studio JavaScript 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 app.start(); line, 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]

Namespace

WinJS.Application

Library

Base.js

 

 

Build date: 12/5/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.