locked
I am building an Epub Reader Html - javascript based Metro App, i have downloaded the epub in app localfolder and extracted it there. now i need to reference the Html pages containing css,js etc from my app, but no success..

    Question

  • I am building an Epub Reader Html - javascript based Metro App, i have downloaded the epub in app localfolder and extracted it there. now i need to reference the Html pages containing css,js etc from my app, but no success..

    I am trying to open the html page the like

    <a href="ms-appdata:///local/epub/cover.html" >Cover Page</>

    but no success. 

    or can i make XMLHttpRequest() request to these content.

    Wednesday, September 26, 2012 9:10 AM

All replies

  • You should just do this:

    <a href="epub/cover.html">

    ensure the files are added to your project in the folder specified (epub) and marked as content.


    Jeff Sanders (MSFT)

    Thursday, September 27, 2012 2:47 PM
    Moderator
  • i have downloaded it inside app data, its not inside the app package., 
    Tuesday, October 02, 2012 12:15 PM
  • The reason that it's not doing anything for the href is because there isn't an application installed on the machine to handle a link of type "ms-appdata" (Try loading the cover.html in IE and clicking on the link to see what's happening behind the scenes in your app.)

    You could do an XHR or use the storage APIs to read the file, if you want to display the contents in the app itself you could always use an iframe with the src set to the link in your local folder (src for iframe will resolve with the ms-appdata protocol)

     
    <iframe src="ms-appdata:///local/epub/cover.html"></iframe>

     

     


    Nick Eubanks (MSFT)

    Tuesday, October 02, 2012 6:21 PM
  • Unfortunately, the caveat—there always seems to be one with the app container!—is that ms-appdata can be used only for resources, namely with the src attribute of img, video, and audio elements. It cannot be used to load HTML pages, CSS stylesheets, or JavaScript, nor can it be used for navigation purposes (iframe, hyperlinks, etc.).

    Ref:  "Developing Windows 8 Apps" by Kraig Brockschmidt

    Friday, October 05, 2012 12:54 PM

  •  @Dipesh008 

      Hi, I am trying do the same thing as Epub Reader using HTML/JavaScript. Do you got the success.
    Rather than anchor tag which control you used. 

     Waiting for your reply.

    Thanks.

    devendra

    Sunday, January 05, 2014 10:29 AM