locked
To develop a metro app using JS and html ,how to access the upper directory?

    Question

  • Previously, in JavaScript using<Script src="../xxx"> to access the upper directory. But in metro App, it can't works. So the question is how to access the upper directory in the JavaScipt coding in  the metro app?  thanks!
    Wednesday, July 18, 2012 3:37 AM

Answers

  • Which is to say that src="/..." refers to the root of your app package (the /) and you can do relative references from there. If for some reason you've loaded an HTML page that's in a subfolder of the app package, then ../ can be used to refer to something in the package root, but then you might as well just prefix it with / to begin with.

    As Jeff suggests, trying to get to the parent folder of the app package isn't allowed.

    If you have a particular scenario in mind we might be able to be more specific.

    .Kraig

    • Proposed as answer by Dino He Thursday, July 19, 2012 7:28 AM
    • Marked as answer by Dino He Thursday, July 26, 2012 8:25 AM
    Thursday, July 19, 2012 12:05 AM

All replies

  • You cannot.  Use the actual directory.

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, July 18, 2012 2:21 PM
    Moderator
  • Which is to say that src="/..." refers to the root of your app package (the /) and you can do relative references from there. If for some reason you've loaded an HTML page that's in a subfolder of the app package, then ../ can be used to refer to something in the package root, but then you might as well just prefix it with / to begin with.

    As Jeff suggests, trying to get to the parent folder of the app package isn't allowed.

    If you have a particular scenario in mind we might be able to be more specific.

    .Kraig

    • Proposed as answer by Dino He Thursday, July 19, 2012 7:28 AM
    • Marked as answer by Dino He Thursday, July 26, 2012 8:25 AM
    Thursday, July 19, 2012 12:05 AM
  • Thanks for your help

    Thursday, August 02, 2012 1:23 AM