NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Web Design Discussion
Reload this Page linking to another page and opening a specific document into an IFRAME

Web Design Discussion Discussion of web design techniques, advice, browser issues, software, design firms.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 06-23-2005, 02:39 PM THREAD STARTER               #1 (permalink)
New Member
Join Date: Apr 2005
Posts: 3
makermet is an unknown quantity at this point
 



linking to another page and opening a specific document into an IFRAME


Hi there...

I'm having some trouble figuring out how to set this up:

Basically, I want to be able to have a link on "page1", that links to "page2". On page2 there is an IFRAME. When page2 opens, I want a specific document loaded into the IFRAME, not the default one stated in the src property of the IFRAME tag.

I'm guessing I'd somehow need to put a variable into the link URL that is passed to the new document, then the variable (the document name to be loaded into the IFRAME) is passed onto the IFRAME.

Anybody have any idea how to do this?

Thanks in advance.

sorry: this has been sorted now. thanks.
makermet is offline  
Old 06-24-2005, 10:20 AM   #2 (permalink)
NamePros Member
Join Date: Jun 2005
Location: Cagliari, Italy
Posts: 29
WiredEyes is an unknown quantity at this point
 



If you have access to some server side language like ASP then this is easy

-- link --
HTML Code:
link.com/default.asp?fsrc=apage.htm
-- page source --
HTML Code:
<iframe src="<%=request("fsrc") %>">
If not then using javascript is the next step which is somewhat trickier.

HTML Code:
// as part of the header
function loadframesrc(){
var URL = unescape(window.document.location);
if (URL.indexOf("?") > -1) { 
//whether the location contains a "?" or not
var list1 = URL.split("?");
//split at "?";
var list2 = list1[1].split ("=");
//split at "=";
var theurl = list2[1];
//assignment
document.frames['framename'].location.href = theurl 
}
}
then you need to add the following to the body tag.
????: NamePros.com http://www.namepros.com/web-design-discussion/101264-linking-another-page-opening-specific-document.html

<body onload="loadframesrc()">

Untested but something like the above would work as long as its the first variable pair in the url.
WiredEyes is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 01:36 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger