ssffcc Posted March 20, 2006 Share Posted March 20, 2006 hi, I have a top-bottomLeft-bottomRight frameset and three pages (details01.html, details02.html and details03.html): <frameset rows="80,*" cols="*" frameborder="no" border="0" framespacing="0"> <frame src="topFrame.html" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" /> <frameset cols="80,*" frameborder="no" border="5" framespacing="0"> <frame src="leftFrame.html" name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" /> <frame src="mainFrame.html" name="mainFrame" id="mainFrame" title="mainFrame" /> </frameset> </frameset> on leftFrame.html, I want to have navigation links to the three pages. when the link of "details01.html" is clicked, the mainFrame.html will display the details01.html, when the link of "details02.html" is clicked, the mainFrae.html will display the details02.html.is it possible to do this with javaScript? plz help, I am new to javaScript Link to comment Share on other sites More sharing options...
ssffcc Posted March 20, 2006 Author Share Posted March 20, 2006 I wrote this in HTML: <h5>details 01 </h5><br /><a href="javascript:setPage()">details01</a> and this in java script: <script type="text/javascript"> function setPage() { parent.leftFrame.document.src="lab1_Details.html"; } </script> nothing is happening, plz help Link to comment Share on other sites More sharing options...
scott100 Posted March 20, 2006 Share Posted March 20, 2006 window.parent.frames['Right'].location='http://www.google.com';Right = the name of the frame Link to comment Share on other sites More sharing options...
ssffcc Posted March 20, 2006 Author Share Posted March 20, 2006 thx scott very much for your help, it works well Link to comment Share on other sites More sharing options...
ssffcc Posted March 20, 2006 Author Share Posted March 20, 2006 another relevant question: I have these lines of code to generate a page with 6 horizontal frames: <frameset cols="20%,15%, 25%, 15%, 10%, 15%"> <frame src="frame_a.htm"> <frame src="frame_b.htm"> <frame src="frame_c.htm"> <frame src="frame_d.htm"> <frame src="frame_e.htm"> <frame src="frame_f.htm"></frameset><noframes></noframes> is it possible to have JavaScript to generate the HTML and display the pages side by side in a frameset (getting the same result of the above code)? Link to comment Share on other sites More sharing options...
scott100 Posted March 20, 2006 Share Posted March 20, 2006 for javascript to generate html, put it all in a document.write() <script>document.write('<frameset cols="20%,15%, 25%, 15%, 10%, 15%">');document.write('<frame src="frame_a.htm">');document.write('<frame src="frame_b.htm">');document.write('<frame src="frame_c.htm">');document.write('<frame src="frame_d.htm">');document.write('<frame src="frame_e.htm">');document.write('<frame src="frame_f.htm">');</script> Let me know if it's not what you needed Link to comment Share on other sites More sharing options...
ssffcc Posted March 20, 2006 Author Share Posted March 20, 2006 done, I think i previously put it into <body> section, that why nothing worked. now i put them in heading section, it works fine. thx for your help again very much scott! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now