Click to See Complete Forum and Search --> : Creating Frames with JavaScript


Trevor
10-23-2003, 12:01 AM
Hi there everyone.

I have this code currently.

<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from non-javascript browsers
document.write('<FRAMESET COLS="126,*" cols="*" frameborder="NO" border="0" framespacing="0">');

document.write('<FRAME SRC="main_nav.html" NAME="navFrame" scrolling="NO" noresize marginwidth="0" marginheight="0">');

document.write('<FRAME SRC="' + Vars[1] + '" NAME="pageFrame">');

document.write('</FRAMESET>');
//-->
</SCRIPT>

I am trying to pass a parameter to the .html that has this code in it like this: www.mypage.com/index.html?=page

what I want is in the second frame, to have page.html come up. The variable Vars[1] already holds "page" but I'm not sure how to tack on the ".html" to make this code load the page "page.html".

Any ideas would be awesome.

Thanks

requestcode
10-23-2003, 07:06 AM
Try this:
document.write('<FRAME SRC="' + Vars[1] + '.html" NAME="pageFrame">');

Trevor
10-23-2003, 11:16 AM
I works great. Thanks.