0

The project contains an <iframe> on the left which displays links to files in different ways (order of include, inheritance, and filepath styles) and an <iframe> on the right which displays the selected file.

What I'm trying to do is make it so the url (top) reflects what should be shown in both of these iframes, so copy pasting the url will result in the same view. I could do it easily with js, but I'm trying to do without.

Is it possible to modify the main url in a way that reflects the state of these iframes without js?

top: address bar; left: index; right: iframe

asked Oct 22, 2017 at 22:51

2 Answers 2

1

No, there is no such mechanism in pure HTML.

You could make this work with some server-side processing – make the links actually redirect the user to a different page, then the server processes the URL query string to know what to display in which part of the page.

Or you could use JavaScript, and use the # part of the URL to store the current location.

There is potentially another way to do it now, with CSS3, although this would be extremely tedious (IMHO), and would also mean your entire website is contained and served in one single file. CSS has a :target selector which would match e.g. <a name="foo"> when #foo was in the URL. Using this you could wrap parts of the page in "targetted" blocks, which would only display when they are needed.

Note that all three of these solutions basically replace your <iframe>s completely.

answered Oct 22, 2017 at 22:57
Sign up to request clarification or add additional context in comments.

Comments

1

You can have the individual links inside the iframe open a new url in the parent window, reloading both iframes, and showing the new full url as you're asking.

<a href="Polygon.hpp.html" target="_parent">Polygon.hpp</a>
answered Oct 22, 2017 at 22:57

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.