PDA

View Full Version : Question regarding iFrames




VPrime
May 4, 2009, 07:36 PM
Hey, I have a site I developed for some one.. This site uses an iFrame for all of the content.
So when they click a link on the page the frame loads the data.

Now what I want to know is if its possible to link some one to the site but have the frame load up what I want.

Eg.
I have my index.html with an iFrame that goes to default.html. One of the links int he navigation go to contact.html

Right now if I give some one the url to my site I give them www.example.com and it loads up the default.html.

What if I want them to go to the site but have the frame load up contact.html

Is it possible? Did any of this make sense?
Thanks.



Darth.Titan
May 4, 2009, 09:02 PM
Took me a minute to wrap my brain around what you were asking, but I'm pretty sure you'll have to use server-side scripting so you can pass which frame content you want to the index page.

Something like:
www.example.com/index.php?content=contact.html

Not pretty, but that's all I can think of.
Anyone else?

angelwatt
May 4, 2009, 09:30 PM
n additional way from the above is to use JavaScript. As the user navigates the site you can update the URL with a hash on the end e.g., #page1. It's not a great solution, but that's part of the problem with making the site inside an iframe. I'd work on getting it out of that if possible.