0 Replies Latest reply on Mar 31, 2008 10:29 AM by bb97202

    HTML app-storage path iframe targeting question

    bb97202
      In my HTML/Javascript app, I'm displaying html content that lives in my app-storage area in an iframe. I assign the src to the iframe dynamically in javascript. This works on the mac, but when I view in Windows, the iframe is empty.

      Here is how I create the src path:
      var docs = air.File.applicationStorageDirectory.resolvePath("preview/index.html")
      var url = new air.URLRequest(docs.nativePath);
      $('previewFrame').src = url.url;

      This creates a path similar to the following:
      mac: /Users/{username}/Library/Preferences/{appID}/Local Store/preview/index.html
      pc: C:\Documents and Settings\{username}\Application Data\{appID}\Local Store\preview\index.html

      Here is the iframe setup:
      <iframe id="previewFrame" src="preview.html" sandboxRoot=" http://localhost" documentRoot="file:/" allowcrossDomainxhr="true"></iframe>

      I tried changing the src path to use .url instead of .native path, like this
      var docs = air.File.applicationStorageDirectory.resolvePath("preview/index.html")
      var url = new air.URLRequest(docs.url);
      $('previewFrame').src = url.url;

      This creates the following path:
      app-storage:/preview/index.html

      But if I change my iframe documentRoot to "app-storage:/", or leave it as "file:/", I see nothing in the iframe, on either mac or PC.

      Can anyone point me to what I'm missing?

      Thanks!