0
          args.setPromise(WinJS.UI.processAll().then(TodoList.init()));

The above statement throws me an exception that TodoList is undefined.Actually, TodoList.js is a Javascript file located in the js folder of the Metro App Blank Project along with default.js.I am calling the init() function of the TodoList js file.What is wrong here?

1 Answer 1

1

I've no idea what you do wrong. But it works for me. I created js file with next content:

var TodoList = {
    init: function () {
        (new Windows.UI.Popups.MessageDialog("TodoList.init()", "Message")).showAsync().done();
    }
};

and I added link to this file in default.html:

<link href="/css/default.css" rel="stylesheet" />
<script src="/js/TodoList.js"></script>
<script src="/js/default.js"></script>

and I got my message. Please, recheck your code at least for reference to your js file.

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, Windows 8 JavaScript apps work just like web pages, make sure you have a <script> tag in your html file!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.