aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes newbie multiple frames problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "newbie multiple frames problem" Watch "newbie multiple frames problem" New topic
Author

newbie multiple frames problem

Chandhrasekar Saravanan
Ranch Hand

Joined: Jun 16, 2002
Posts: 57
Hi ,

I am new to JavaScript. i have to develop something like this. i have 2 frames an upper and lower frame. i need to display the address of the upper frame in my lower frame . my upper frame is used to browse websites and my lower frame should display the web addresses . i have developed a sample code ,but i have problem in displaying the address of the upper frame in the textbox of the lower frame. please help me with this.
my Frameset code is
<html>
<head>
<title>Testing history and location object javascript</title>
</head>
<frameset rows="76/,24/" >
<frame src="http://www.cnn.com">
<frame src="navaigation.html" >
</frameset>
</html>
my lower frame (navigation.html)code is
<html>
<head>
<title>Navigation Bar</title>
<SCRIPT>
function go_forward()
{
document.write(parent.frames[0].location.href);
}
</SCRIPT>

<!-- Here's the form, with event handlers that invoke the functions above. -->
<FORM NAME="navbar" >
<INPUT TYPE="button" VALUE="Forward" Click="go_forward()">
URL:
<INPUT TYPE="text" NAME="url" SIZE=50>
</FORM>
</head>
</html>

i need to display it in the address in the textbox, but i couldnt so i tested with an button. this works fine for local html pages,but i couldnt display the address like "http://www.cnn.com" or any internet address. also even if i refresh the page i dont get the initial page with button and text. i only get the blank page.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
okay first off there are security restrictions about getting stuff from other servers/urls which limits you to what you can do
second off the syntax you are using is correct, but I find it to be buggy at times. I would name the frames and access it by the name
example
<frameset rows="76/,24/" >
<frame name="MainF" src="http://www.cnn.com">
<frame name="BottomF" src="navaigation.html" >
</frameset>
</html>
in the bottom frame try this code
<form name="L">
<input type="button" onclick="this.value=parent.document.MainF.location.href" value="click me">
</form>
Eric
Chandhrasekar Saravanan
Ranch Hand

Joined: Jun 16, 2002
Posts: 57
Isn't there an any other way that i could catch the webaddresses on the flow, like i need to get these web addresses . kindly suggest me an way. history object would not suit my application
Thanking you
Chandhrasekar Saravanan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: newbie multiple frames problem