Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I make a frameset depending on a given variable 1

Status
Not open for further replies.

johpje

Programmer
Jan 3, 2002
87
BE
I need 1 html file with 2 frames (frames.html) to display the both frames, depending on a variable given in the URL.
The first frame should call a fixed html-file with the same variable, the second frame needs to call a asp-page with that name

ex: given URL="frames.html?var=XYZ"
frame1 = "title.html?var=XYZ"
frame2 = "XYZ.asp"

note: where offcourse the XYZ in the example is variable.

I hope this is possible, otherwise i have to make like 40 different frame-files, for each case :p

johpje
 
here, try something like this:
Code:
<html> <head> <title></title> 
<script language='javascript'>
function changeStuff()
{
searchStr = document.location.search.substring(1,document.location.search.length+1).split('=')[1];
window.frames[0].location.href = 'title.html?dVar='+searchStr;
window.frames[1].location.href = searchStr+&quot;.asp&quot;;
}
</SCRIPT> </head>
<frameset cols=&quot;20%,80%&quot; frameborder=yes onLoad='changeStuff()'>
  <frame src=&quot;&quot; id=&quot;yea&quot;>
<frame src=&quot;&quot;>
</frameset>
</html>
hope it helps! &quot;Those who dare to fail miserably can achieve greatly.&quot; - Robert F. Kennedy
So true..
 
It works like a charm!
Thanks a lot Dookie!

Johpje

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top