DEV Community

Calin Baenen
Calin Baenen

Posted on

Is it possible to set "the master URL" from within an IFrame? [SOLVED]

Is it possible to set the URL of the currently view document by clicking an <a>nchor element in an <iframe>?

I want to add chapters to a document I'm making in a similar to way to how The Rust Book has chapters, but I don't want to have a bunch of filler HTML on my computer, so I decided I would just make one file, sitemap.html, and just load it into an <iframe> on the side of every document, but every time I click on one of the <a>s it doesn't have the intended behavior.

Is there any way to get the behavior I described or must I repeat my HTML inline to get the desired effect?

Top comments (1)

Collapse
 
baenencalin profile image
Calin Baenen

I figured it out, in the document I was embedding I just needed to add target="_top" on the <a> elements.
Now I learned what HTML page targets are, I guess.