Search code examples
javascriptcordovawinjs

How do you add winjs to a cordova project?


I've made a cordova project but I can't find any documentation on how to add winjs to it


Solution

  • You should be able to use this like any other JS library. Get the CSS and JS files for it from the download site (see Loose Files) then put them somewhere within your Cordova project's "www" folder, and refer to them in your index.html using relative URLs.

    For example if I put them in "www/res/winjs" I would then need script and link tags like so in index.html:

    <link href="res/winjs/ui-light.css" rel="stylesheet" />
    <script src="res/winjs/base.js"></script>
    <script src="res/winjs/ui.js"></script>
    

    You can then use WinJS like you normally would as per the documentation on the Microsoft site.