So I stupidly decided to make my website using i-frames to load pages so that I could keep a sidebar on the main page and not have to go through and change this each time. What I should have done is the opposite where the sidebar is in the Iframe. My question is, is there anyway I could could use the URL to load a specific page into this Iframe?
E.g http://example.com/gallery
and use this to load the gallery page into the I-Frame.
To load each page into the Iframe from the sidebar I am using
<a href="gallery.html" onclick="UpdateIFrame()" target="displayframe">Gallery</a>
where UpdateIFrame()
is just closing the sidebar and updating the length of the I-Frame.
I was thinking of somehow using JS to read what the URL is or have it point to a file that will load the correct page however I am unsure of how to go about this.