0x800a1391-JavaScript运行时错误:';应用程序';是未定义的

0x800a1391-JavaScript运行时错误:';应用程序';是未定义的,javascript,microsoft-metro,windows-8.1,Javascript,Microsoft Metro,Windows 8.1,我正在学习《HelloWorldWithPages》的教程 0x800a1391-JavaScript运行时错误:“应用程序”未定义 它就出现在这里:返回nav.navigate(Application.navigator.home) 以下是完整的文件: default.js // For an introduction to the Navigation template, see the following documentation: // http://go.microsoft.com/

我正在学习《HelloWorldWithPages》的教程

0x800a1391-JavaScript运行时错误:“应用程序”未定义

它就出现在这里:
返回nav.navigate(Application.navigator.home)

以下是完整的文件:

default.js

// For an introduction to the Navigation template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkId=232506
(function () {
    "use strict";

    var app = WinJS.Application;
    var activation = Windows.ApplicationModel.Activation;
    var nav = WinJS.Navigation;

    app.addEventListener("activated", function (args) {
        if (args.detail.kind === activation.ActivationKind.launch) {
            if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) {
                // TODO: This application has been newly launched. Initialize
                // your application here.
            } else {
                // TODO: This application has been reactivated from suspension.
                // Restore application state here.
            }

            // Save the previous execution state. 
            WinJS.Application.sessionState.previousExecutionState =
                args.detail.previousExecutionState;

            if (app.sessionState.history) {
                nav.history = app.sessionState.history;
            }
            args.setPromise(WinJS.UI.processAll().then(function () {
                if (nav.location) {
                    nav.history.current.initialPlaceholder = true;
                    return nav.navigate(nav.location, nav.state);
                } else {
                    return nav.navigate(Application.navigator.home);
                }
            }));
        }
    });

    app.oncheckpoint = function (args) {
        // TODO: This application is about to be suspended. Save any state
        // that needs to persist across suspensions here. If you need to 
        // complete an asynchronous operation before your application is 
        // suspended, call args.setPromise().
        app.sessionState.history = nav.history;
    };

    app.start();
})();

如果我还需要显示其他文件中的代码,请告诉我。我无法理解为什么这个问题不断出现。

这仅仅意味着全局符号“应用程序”未定义。在其他地方,您可以参考
WinJS.Application
。在这种情况下,这可能就是您需要做的。@Pointy WinJS.Application不正确。“home”不是WinJS.Application.navigator的有效属性。