User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 455,974 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,754 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1337 | Replies: 2 | Solved
Reply
Join Date: Sep 2005
Location: St. Louis
Posts: 145
Reputation: kahaj is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
kahaj kahaj is offline Offline
Junior Poster

Help Frame Usage

  #1  
Nov 27th, 2007
It's been forever and a day since I used frames. I'm sure I have it all plugged in right, but I've never used JavaScript w/ frames. Do I have the links coded properly in the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd">
<!--leftFrame.html-->

<html>
<head>
<title />Left Frame</title>
<script type="text/javascript">

</script>
</head>
<body>

<p>
<a href="" onclick="main.frames[2].document.open(ar.html);main.frames[2].document.close();return false;"><img src="9-AR.jpg" border="0" target="main"></a><br />
<a href="" onclick="main.frames[2].document.open(ia.html);main.frames[2].document.close();return false;"><img src="9-IA.jpg" border="0" target="main"></a><br />
<a href="" onclick="main.frames[2].document.open(il.html);main.frames[2].document.close();return false;"><img src="9-IL.jpg" border="0" target="main"></a><br />
<a href="" onclick="main.frames[2].document.open(ks.html);main.frames[2].document.close();return false;"><img src="9-KS.jpg" border="0" target="main"></a><br />
<a href="" onclick="main.frames[2].document.open(main.html);main.frames[2].document.close();return false;"><img src="9-Main.jpg" border="0" target="main"></a><br />
<a href="" onclick="main.frames[2].document.open(mo.html);main.frames[2].document.close();return false;"><img src="9-MO.jpg" border="0" target="main"></a><br />
<a href="" onclick="main.frames[2].document.open(ne.html);main.frames[2].document.close();return false;"><img src="9-NE.jpg" border="0" target="main"></a><br />
</p>

</body>
</html>

Also, here is the main html doc:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd">
<!--StateStatistics.html-->

<html>
<head>
<title />State Statistics</title>
<script type="text/javascript">

window.defaultStatus = "State Statistics";

</script>
</head>
<body>

<frameset cols="20%, 80%" frameborder="no" border="0">
	<frame src="leftFrame.html" name="left" />
	<frame src="main.html" name="main" />
</frameset>

</body>
</html>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 7,009
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 25
Solved Threads: 368
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Frame Usage

  #2  
Nov 27th, 2007
» You can't use the <body> tags when using <frameset> tags. Remove those from your main.html
» You are referring to the frames in a wrong manner. Use the 'top' property of the window object to refer to the parent window. You can then access the frames using top.frames['frameName'].
» For your document.write to write to the desired frame and not the current frame, use the target property of the <a> tag and set it to the frame you want. Something like:
<a href="#" target="right" onclick="something();">Linky</a>
» <title />State Statistics</title> is an incorrect way of writing the <title> tag.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Join Date: Sep 2005
Location: St. Louis
Posts: 145
Reputation: kahaj is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
kahaj kahaj is offline Offline
Junior Poster

Re: Frame Usage

  #3  
Nov 27th, 2007
Okay, got if fixed and working. Thanks a lot!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 9:16 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC