Click to See Complete Forum and Search --> : Frames
Jeremy Martin
Feb 6th, 2001, 09:29 AM
Ok I have a question and need a little help.
I have this page that has 3 frames on it. What I need to do is have a way so I can put an address after the page and have it change on of the frames to a different address. Ex. http://www.mysite.com/mypage.(cgb,asp,php, something)(?, or some seperator)www.hotmail.com
I guess the frame name that i want to change would be main and i want it so the above sytax would load the hotmail or someother page in the frame called main.
Jeremy
Kagey
Feb 6th, 2001, 10:58 AM
If you want to change the address of a frame, in a link tag you specify the target:
<a href="www.hotmail.com" target="FRAMENAME">Click Here!</a>
I dont know if that is what you wanted, but it might get you started.
and the stuff after the "?" in the address is called a querystring, and you can use javascript if you want to capture the value and transfer the appropriate frame to the value. Of course, im a server side guy and i dont know how. you could probably search this forum for javascript and querystrings and find out how though.
have fun.
Mark Sreeves
Feb 7th, 2001, 06:19 AM
I think this is what you want.
use it like this:
http://sl00257/scratch/frames.htm?m=http://www.vb-world.net
this will load http://www.vb-world.net into the main frame
<script language=Javascript>
var m = window.location;
m = '' + m;
var i = m.indexOf('?m=');
var mainUrl = m.substring(i+3);
document.write('<FRAMESET ROWS="100,*" FRAMEBORDER="no" FRAMESPACING="0" FRAMEBORDER="0" BORDER="0">');
document.write('<FRAME NAME="top" SRC="top.html" MARGINHEIGHT="10" MARGINWIDTH="10" SCROLLING=no> ');
document.write('<FRAMESET Cols="100,*" FRAMEBORDER="no" FRAMESPACING="0" FRAMEBORDER="0" BORDER="0"> ');
document.write('<FRAME NAME="left" SRC="left.html" MARGINHEIGHT="10" MARGINWIDTH="10" SCROLLING=YES> ');
document.write('<FRAME NAME="main" SRC="' + mainUrl + '" MARGINHEIGHT="10" MARGINWIDTH="10" SCROLLING=YES>');
document.write('</FRAMESET></FRAMESET>');
</script>
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.