locked
HTML,JavaScript and CSS file referenced in Windows 8 WinRT from Install Location

    Question

  • Hi,

    I want to refer my html, javascript and css file from install location using 

    Windows.ApplicationModel.Package.current.installLocation

    But i was not able to refer my static file within win 8 app.

    Code: This code is refer only js file

    var uriInstallLocal = new Windows.Foundation.Uri('ms-appx://src/test.js');

    var fileInstallLocal = Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uriInstallLocal );

    Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uriInstallLocal).done(function(fileInstallLocal ){

    var jsPath = fileInstallLocal.path;

    var fileref = document.createElement('script');

     fileref .setAttribute("type","text/javascript");

     fileref .setAttribute("src",jsPath);

    document.getElementByTagName("head")[0].appendChild(fileref);

    });

    Is it possible?

    Thanks and Regards,

    Shishir



    shishir

    Thursday, October 17, 2013 6:32 AM

Answers

All replies