Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Javascript to check frame status

Posted on 1999-06-28
6
Medium Priority
?
1,040 Views
Last Modified: 2012-06-27
Hi experts,
  I have 3 frames (name = "1", name = "2", name = "3")
  I want frame 1 (using javascript) to check whether     frame   2 document(Page)
  has been loaded properly. if not load the page for
  frame 2

  Is it possible and how ?

  Thanks
0
Comment
Question by:seahpc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 2

Expert Comment

by:nikhilh
ID: 1851306
Each frame is treated as a window object.

So if you say window.parent.1 this will give you access to frame "1". Then you can use this as a window object.

This is assuming that all the 3 frames have the same parent.
0
 
LVL 2

Author Comment

by:seahpc
ID: 1851307
The main problem I encounter is that I want to check whether
a particular frame has successfully loaded its page.
 from a javascript at another frame .

0
 
LVL 8

Accepted Solution

by:
xabi earned 120 total points
ID: 1851308
1st: in frame "2" add this to <body>

<body .... foo foo  .... onload="loaded=1">

2nd: in frame 1 you can use this function

<script language="javascript">
if (parent.f1 != null) {
function check() {
 frame_loaded = 0
 if (parent.2 != null) {
   if (parent.2.loaded == 1) frame_loaded = 1
 }
 if (frame_loaded == 1) {
   do_what_you_want_if_loaded()
 }
}
</script>

Hope it helps you

Xabi
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Expert Comment

by:xabi
ID: 1851309
Sorry

s/parent.f1/parent.1
0
 
LVL 8

Expert Comment

by:xabi
ID: 1851310
Sorry again this is the good code (damn keyboard):

1st: in frame "2" add this to <body>

<body .... foo foo  .... onload="loaded=1">

2nd: in frame 1 you can use this function

<script language="javascript">
function check() {
 frame_loaded = 0
 if (parent.2 != null) {
   if (parent.2.loaded == 1) frame_loaded = 1
 }
 if (frame_loaded == 1) {
   do_what_you_want_if_loaded()
 }
}
</script>

Hope it helps you

Xabi
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6809404
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This is a manual correction, so that the expert will now receive the points you awarded, and I have verified that you were not charged points again for this adjustment.  
 
Thanks,
Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question