We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Iframe Help
Topic Started: Oct 14 2005, 10:14 PM (422 Views)
raiagulon
the magnificent
[ *  * ]
I'm looking for a way to externally link to a page which contains an iframe, but without opening the default page in it. In other words, say my index page has an iframe in it. Now, when you normally go to it, the iframe has a page called Updates. Now, I want to link to the main page from somewhere else, but instead of opening Updates, I would like a page called Content within the iframe.

Any help is appreciated.
Offline Profile Quote Post Goto Top
 
IceMetalPunk
Member Avatar
We are all IMPerfect. Be proud!
[ *  *  *  *  *  * ]
You could try something like this:

Quote:
 
At the bottom of your Index page:
Quote:
 
<script>
if (window.location.search && window.location.search.indexOf("frame=1")!=-1) {
iframes=document.getElementsByTagName("iframe");
for (h=0; h<iframes.length; h++) {
if (iframes[h].name=="MYIFRAME[/color]") {
iframes[h].src="MYSECONDURL[/color]";
break;
}
}
}
</script>


Now, change the RED part to the name of the IFRAME, and the GREEN part to the URL you want it to go to when it came from the external link.

Then, instead of linking to the URL of the Index page, link to the URL of the Index page with ?frame=1 at the end.

-IMP ;) :)
Offline Profile Quote Post Goto Top
 
raiagulon
the magnificent
[ *  * ]
Thanks for your help.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply