473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

How to display the page from child window to parent frame.

Hi,

I am new to javascript.
This is my problem description.
Actually I have 3 pages.
In the first page I have 2 frames.
In the first page(first) from one of the frame(first), I have a link to another page(second).
From the second, I have opened new page(third).
these and all i did in html.
But the problem is from the third page , I have to dispaly some contents to the
second frame of the first page using the javascript function and on_click event.
The code as follows:
The Code for first page:

[HTML]<html>
<head>
</head>

<frameset rows="50%,50%">


<frame src="D:\frame_b.html" name="first">
<frame src="D:\frame_c.html" name="second">

</frameset>

</html>

The code for second page:
<html>
<head>
</head>
<body>
this is frame_b
<a href="D:\link.html"target="_blank">click here</a>
</body>
</html>

Code for third page:
<html>
<head>
</head>
<body>
this is the new page open in new window
<a href="D:\sample.html"target="_blank">click here</a>
</body>
</html>
Code for fourth page:
<html>
<head>
</head>
<body>
this is sample html page
<script>
function testing()
{
window.parent.second.location="D:\frame_c.html"

}
</script>
<a href="#" onClick="javascript:testing();return false">Say Hi</a>

</body>
</html>

The code for the text display in secod frame:
<html>
<head>
</head>
<body>
this is frame_c

</body>
</html>[/HTML]

Where I am doing mistake ? please help me
Attached Files
File Type: zip script.zip (4.5 KB, 115 views)
Oct 11 '07 #1
8 4605
dmjpro
2,476 2GB
try this ..............

Expand|Select|Wrap|Line Numbers
  1. window.parent.second.location.href="D:\frame_c.html"
  2.  
Debasis Jana
Oct 11 '07 #2
try this ..............

Expand|Select|Wrap|Line Numbers
  1. window.parent.second.location.href="D:\frame_c.html"
  2.  
Debasis Jana
Hi Debasis,

Thank you.
But I got the error in my last probgram
Error :

I got the error in line 9 and in character 15.
window.parent.second.location is null or not an object.

please help me....

Thanks and regards,
Susi
Oct 12 '07 #3
dmjpro
2,476 2GB
Hi Debasis,

Thank you.
But I got the error in my last probgram
Error :

I got the error in line 9 and in character 15.
window.parent.second.location is null or not an object.

please help me....

Thanks and regards,
Susi
What is second?
I think it is a frame....named second.
then try it ..........

Expand|Select|Wrap|Line Numbers
  1. window.parent.frames["second"].location.href = "...";
  2.  
Debasis Jana
Oct 12 '07 #4
What is second?
I think it is a frame....named second.
then try it ..........

Expand|Select|Wrap|Line Numbers
  1. window.parent.frames["second"].location.href = "...";
  2.  
Debasis Jana
Hi Debasis,

Ya its one of the frame in the first page.

Thank you,
Susi
Oct 12 '07 #5
dmjpro
2,476 2GB
Hi Debasis,

Ya its one of the frame in the first page.

Thank you,
Susi
Now what is happening??
The frame is first, second or what?

Debasis Jana.
Oct 12 '07 #6
Now what is happening??
The frame is first, second or what?

Debasis Jana.
Hi Debasis,

Its second frame.But now also I am getting the same error.
If the parent means , is it identify the direct page only or the first page?

Thanks and Regards,
Susi
Oct 12 '07 #7
Hi,

I tried the following in the last file.Its working fine.But throws javascript error.

[HTML]<html>
<head>

</head>
<body>
this is sample html page
<a href="D:\frame_c.html" target="second" onClick="parent.frames[second].location.href="D:\frame_c.html" return false;">Say Hi</a>
</body>
</html>[/HTML]

Thanks and Regards,

Susintha
Oct 12 '07 #8
gits
5,390 Expert Mod 4TB
since 'second' is a value of an attribute its a string ... so use:

Expand|Select|Wrap|Line Numbers
  1. parent.frames['second'].location.href='D:\\frame_c.html';
kind regards

ps: note ... you cannot use the double quotes inside the onclick statement, simply use single quotes or escape the double ones
Oct 12 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: BGMeshi | last post by:
Hi, The following javascript code (serving a main HTML page) dynamically creates IFRAME to contain other HTML page. Everyting works OK, however when I am trying to access the main HTML page...
6
by: | last post by:
In IE, from the child window of a frameset i use the function top.window.close() And this works in IE, but not in nn4! How can i make this same effect in nn4? please help
10
by: CyberBless | last post by:
I have a page that opens a child window using window.open(...). How do I make so that when that child window opens you cannot get the focus back on the parent window unless you close the child...
3
by: Nathan Burleson | last post by:
Hello, I have a custom control that is used to select a location from a list of locations. When put on the page it creates an asp:textbox (used to display the name of the location), a hidden...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
2
by: gsuns82 | last post by:
hi all, I got to reload parent window from its child window,i used the folloeing code opener.location.reload(); self.close(); in child window. Parent window gets...
1
by: newsteve1 | last post by:
hello, i have a parent page with a bunch of photos. clicking on the first photo will lead to a new child window with a close-up of that photo AND from there you can cycle through all of the other...
1
by: varunvashishth | last post by:
hi, I'm facing a problem with displaying a child jsp on top of parent jsp. on clicking a link in parent jsp the child jsp opens up and it has some list of values and other textboxes which gets...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.