I have a Hype doc living in an iframe inside various HTML pages.
Is there a simple way to get the URL or title of the HTML page from within the Hype document? (Everything I’ve tried via Javascript returns the attributes of the iframe.)
My Hype file and resources live in a separate directory from the HTML pages.
The reason I want to do this is because the Hype document is navigation. By reading the URL or title, I can set the “you are here” part correctly.
var identifier = window.location.hash;
// do something with that information like trigger a custom behavior etc.
Extended approach, sandbox restrictions may apply
If you need more data. You could us a JSON string as a hash or look into the frameElement and use data attributes on the frame and retrieve them from window.frameElement, see