Iframe and browser.location

  • Hi!
    Panorama is embedded in the html page via iframe
    When I use the browser.location I can get the URL of the iframe page, but not the parent page
    Is it possible to get the URL of the parent page?

    translation difficulties *huh*

  • Hi,

    here some code for getting the top window location:

    Code
    <action name="get_top_location">
      set(top_location,null);
      jscall('try{ krpano.set("top_location", top.location.href); }catch(err){}');
      trace('top_location=',top_location);
    </action>

    But this will only work when the iframe and the outer page are on the same domain and port.
    Otherwise the browser will not allow the access - and in the example above the top_location variable will be null in this case.

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!