| | |||||
| ||||||||
| Web Design Discussion Discussion of web design techniques, advice, browser issues, software, design firms. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| New Member Join Date: Apr 2005
Posts: 3
![]() | 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. |
| |
| | #2 (permalink) |
| NamePros Member Join Date: Jun 2005 Location: Cagliari, Italy
Posts: 29
![]() | 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 HTML Code: <iframe src="<%=request("fsrc") %>"> 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
}
} ????: 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 --- WebClickGo - The Best Online Website Builder on the planet. ServWise hosting - faster, smarter, better, cheaper |
| |