Creating the JavaScript File

The third file that we need to modify is the JavaScript file named default.js which is located in the js folder. This file contains all of the code associated with the default.html page.

We are going to delete all of the default content of this file and start over. The complete contents of the modified version of default.js are contained in Listing 1.2.

LISTING 1.2 The default.js JavaScript file

(function () {    "use strict";    // Aliases    var capture = Windows.Media.Capture;    // Executed immediately after page content is loaded    function init() {        // Process all of the controls        WinJS.UI.processAll().done(function () {            // References to DOM elements             ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.