问题
I have download the code from CodePlex Then I install the sdk's of live,telerik etc
After installation I ran the code and I'm getting the following error
`0x800a1391 - JavaScript runtime error: 'WinJS' is undefined`
The error occured in the Converters.Js file here it is
(function() {
var r = Windows.Storage.ApplicationData.current.roamingSettings.values;
// Export shortDate
WinJS.Namespace.define("codeSHOW.Converters", { // Error Occured here
});
})();
Any help is highly appreciated.
Thanks.
回答1:
Did you include base.js in your htm file before which ever file is making that call?
回答2:
On your default.htm page (or other html pages with the same code) change the WINJS References to the location of this in your app ie
References > Windows Library for JavaScript 2.0 > js > base.js
I had the same problem and just had to remove the .preview on the URL reference from
<!-- WinJS references -->
<link href="//Microsoft.WinJS.2.0.Preview/css/ui-dark.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.2.0.Preview/js/base.js"></script>
<script src="//Microsoft.WinJS.2.0.Preview/js/ui.js"></script>
to
<!-- WinJS references -->
<link href="//Microsoft.WinJS.2.0/css/ui-dark.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.2.0/js/base.js"></script>
<script src="//Microsoft.WinJS.2.0/js/ui.js"></script>
回答3:
You should add to References Windows Library for Javascript
来源:https://stackoverflow.com/questions/13468492/0x800a1391-javascript-runtime-error-winjs-is-undefined