Help us understand the problem. What is going on with this article?

WinJS.Namespace に 関数を登録するときのトラップ - Metro App (javascript)

More than 5 years have passed since last update.

WinJS.Namespace.define() には関数も登録できるけれども、exception が発生してしまう。

エラーメッセージ

WinJS.Utilities.requireSupportedForProcessing: Value is not supported within a declarative processing context, if you want it to be supported mark it using WinJS.Utilities.markSupportedForProcessing.

親切にも WinJS.Utilities.markSupportedForProcessing を使うようヒントをくれているので、素直に従いましょう~

サンプル

example.js
WinJS.Utilities.markSupportedForProcessing(onItemClicked);
WinJS.Namespace.define('SampleData', {onItemClicked: onItemClicked});

APIリファレンス

WinJS.Utilities.markSupportedForProcessing function

dz_
Nice to meet you! :)
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away