473,554 Members | 2,902 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

capturing page load

Hi all. I know this is more of a DOM question, but here it goes:

Browser == Firefox

suppose I have two frames. One has many links and is opening pages in
the other one. I would like to check if the page is finished loading.

This is the example of the "links" frame.
----

<html>
<head>
<title>Frame1 </title>
<script type="text/javascript">
<!--
function loadDocument() {
content = window.open( "frame2.htm l", "Content" );
content.addEven tListener( "load", sayDone, false );
}

function sayDone() {
alert( "done" );
}

//-->
</script>
</head>
<body>
<input type="button" value="Open frame 2" onclick="loadDo cument()">
</body>
</html>

----

The problem I'm having is, that this only works the first time. If I
click on the button again, the load event is not captured. I didn't
find anything useful when searching the web. Can anybody here help?

Thanks in advance, Miha Vitorovic

Mar 29 '07 #1
4 1582
<mi************ @gmail.comwrote in message
news:11******** **************@ n59g2000hsh.goo glegroups.com.. .
Hi all. I know this is more of a DOM question, but here it goes:

Browser == Firefox

suppose I have two frames. One has many links and is opening pages in
the other one. I would like to check if the page is finished loading.

This is the example of the "links" frame.
----

<html>
<head>
<title>Frame1 </title>
<script type="text/javascript">
<!--
function loadDocument() {
content = window.open( "frame2.htm l", "Content" );
content.addEven tListener( "load", sayDone, false );
}

function sayDone() {
alert( "done" );
}

//-->
</script>
</head>
<body>
<input type="button" value="Open frame 2" onclick="loadDo cument()">
</body>
</html>

----

The problem I'm having is, that this only works the first time. If I
click on the button again, the load event is not captured. I didn't
find anything useful when searching the web. Can anybody here help?
I did not test this, it is merely conjecture. Did you try closing your Window instance?
Perhaps in the sayDone() function you can test if it is open, then close it:

if (content.open) { content.close() ; }

Remember, that even after closing your Window instance, the Window object remains. It is
by testing further for the name property, that you see it is null (after closing your
instance).

-Lost
Mar 29 '07 #2
On Mar 29, 2:08 pm, "-Lost" <missed-s...@comcast.ne twrote:
<miha.vitoro... @gmail.comwrote in message

news:11******** **************@ n59g2000hsh.goo glegroups.com.. .
Hi all. I know this is more of a DOM question, but here it goes:
Browser == Firefox
suppose I have two frames. One has many links and is opening pages in
the other one. I would like to check if the page is finished loading.
This is the example of the "links" frame.
----
<html>
<head>
<title>Frame1 </title>
<script type="text/javascript">
<!--
function loadDocument() {
content = window.open( "frame2.htm l", "Content" );
content.addEven tListener( "load", sayDone, false );
}
function sayDone() {
alert( "done" );
}
//-->
</script>
</head>
<body>
<input type="button" value="Open frame 2" onclick="loadDo cument()">
</body>
</html>
----
The problem I'm having is, that this only works the first time. If I
click on the button again, the load event is not captured. I didn't
find anything useful when searching the web. Can anybody here help?

I did not test this, it is merely conjecture. Did you try closing your Window instance?
Perhaps in the sayDone() function you can test if it is open, then close it:

if (content.open) { content.close() ; }

Remember, that even after closing your Window instance, the Window object remains. It is
by testing further for the name property, that you see it is null (after closing your
instance).

-Lost
Tnx for the suggestion - no luck.

Br, Miha Vitorovic

Mar 29 '07 #3
<mi************ @gmail.comwrote in message
news:11******** **************@ y80g2000hsf.goo glegroups.com.. .
On Mar 29, 2:08 pm, "-Lost" <missed-s...@comcast.ne twrote:
><miha.vitoro.. .@gmail.comwrot e in message

news:11******* *************** @n59g2000hsh.go oglegroups.com. ..
Hi all. I know this is more of a DOM question, but here it goes:
Browser == Firefox
suppose I have two frames. One has many links and is opening pages in
the other one. I would like to check if the page is finished loading.
This is the example of the "links" frame.
----
<html>
<head>
<title>Frame1 </title>
<script type="text/javascript">
<!--
function loadDocument() {
content = window.open( "frame2.htm l", "Content" );
content.addEven tListener( "load", sayDone, false );
}
function sayDone() {
alert( "done" );
}
//-->
</script>
</head>
<body>
<input type="button" value="Open frame 2" onclick="loadDo cument()">
</body>
</html>
----
The problem I'm having is, that this only works the first time. If I
click on the button again, the load event is not captured. I didn't
find anything useful when searching the web. Can anybody here help?

I did not test this, it is merely conjecture. Did you try closing your Window
instance?
Perhaps in the sayDone() function you can test if it is open, then close it:

if (content.open) { content.close() ; }

Remember, that even after closing your Window instance, the Window object remains. It
is
by testing further for the name property, that you see it is null (after closing your
instance).

Tnx for the suggestion - no luck.
Do you have a page one can take a look at? I could not imagine that you need to remove
the event listener upon closing your Window instance, but, I could be wrong.

-Lost
Mar 29 '07 #4
On Mar 29, 2:51 pm, "-Lost" <missed-s...@comcast.ne twrote:
>
Do you have a page one can take a look at? I could not imagine that you need to remove
the event listener upon closing your Window instance, but, I could be wrong.

-Lost
Sorry, can't do. But I can e-mail you the three HTML files. I's some
13k.

Br, Mike

Mar 29 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
5578
by: Joerg Schuster | last post by:
Hello, Python regular expressions must not have more than 100 capturing groups. The source code responsible for this reads as follows: # XXX: <fl> get rid of this limitation! if p.pattern.groups > 100: raise AssertionError( "sorry, but this version only supports 100 named groups"
4
1414
by: Steve Wolfie | last post by:
Hello all: Again, let me thank everyone who has helped in the past. Can't wait till I can help out with some advice of my own. Now, I am building an app that wishes to retrieve the output of Google Desktop. It is very simple, I wish to send an http request asking for the results in XML. ( by adding &format=xml to the end of the url) i...
2
6399
by: Andrew | last post by:
Hi, I have a problem capturing the checkboxes that are checked, I get false irrespective of wether they are checked or not. I have gone thru the sample code on this forum, but they dun seem to work. This is the code that I used to go thru the repeater control to find my checkboxes. foreach(RepeaterItem r in MyRepeater.Items)
10
5998
by: Andrew | last post by:
Hi, I have a messagebox that pops up due to an event. I did it in javascript. ie. alert("Time's up. Assessment Ended"); I want to capture the OK and Cancel events of this alert messagebox. My code is in C#/ASP.NET. TIA. Andrew.
1
1412
by: louise raisbeck | last post by:
Hi there, i need to ensure a user does something when they exit an asp.net web page. I cant put code behind close buttons, because there are a thousand ways they can exit this page, menu buttons, links etc. Is there any way you can capture the exiting of a page/the moment the server receives a request to move away from a particular url ?...
2
1713
by: Ken Cox - Microsoft MVP | last post by:
I'm trying to find a way to program in ASP.NET 2.0 but capture the HTML output. I found the following routine in ASP.NET 2.0 Cookbook from O'Reilly. It doesn't work if I include a server-side dropdownlist control on the page. The error is RegisterForEventValidation can only be called during Render(); Any ideas? Ken Microsoft MVP
6
2252
by: Ed Leafe | last post by:
I've been approached by a local business that has been advised that they need to start capturing and archiving their instant messaging in order to comply with Sarbanes-Oxley. The company is largely PC, but has a significant number of Macs running OS X, too. Googling around quickly turns up IM Grabber for the PC, which would seem to be just...
3
18270
by: rajibnsu | last post by:
While searching for capturing video with a webcam I god the following code.It gives two errors.Says:The type or namespace name 'WebcamEventArgs' does not exit in the namespace 'WebCam_Capture' (are you missing an assembly reference?) using System; using System.Collections; using System.ComponentModel; using System.Drawing; using...
0
7581
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7782
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8018
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6123
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5423
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3545
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3533
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1114
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
823
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.