473,386 Members | 1,801 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,386 software developers and data experts.

Waiting for a site to finish loading

I have just picked up javascript so that I can write some scripts for
Greasemonkey. For those not familiar with grease monkey it is a program
that allows you to change websites before you view them. Very cool
program.

Anyway I want to write a script that waits until the entire page is
loaded to run. I am working with very large pages that take a while to
load.

Does anyone know how to do this? or any good websites for looking up
this sort of information?

Brett

Jul 23 '05 #1
3 11772
Brett wrote:
...
Anyway I want to write a script that waits until the entire page is
loaded to run. I am working with very large pages that take a while to
load.

Does anyone know how to do this? or any good websites for looking up
this sort of information?

Brett


http://scriptasylum.com/tutorials/pageevents.html

http://www.devguru.com/Technologies/...an_onload.html

Mike
Jul 23 '05 #2

Hmm yeah I found something that said OnLoad was the event I was looking
for but this does not really work. At the moment I am trying to write a
script file that makes a message popup displaying the title of the
page. If this code is run before the title is loaded then it obviously
is not going to work properly.

so far I have this
<SCRIPT>
window.onload( alert(document.title) );
</SCRIPT>

it pops up with a blank message. But when i use this code instead. It
will work provided I have it at the bottom of the page.

<SCRIPT>
alert(document.title);
</SCRIPT>

So it seems that the onload is either not doing what it is supposed to
do or I am not using it properly. Any Ideas?

Brett

Thank you for the web pages btw they will help me alot.

mscir wrote:
Brett wrote:
...
Anyway I want to write a script that waits until the entire page is
loaded to run. I am working with very large pages that take a while to
load.

Does anyone know how to do this? or any good websites for looking up
this sort of information?

Brett


http://scriptasylum.com/tutorials/pageevents.html

http://www.devguru.com/Technologies/...an_onload.html

Mike


Jul 23 '05 #3
Brett wrote:
Hmm yeah I found something that said OnLoad was the event I was looking
for but this does not really work.
It does if you use it properly.
At the moment I am trying to write a script file that makes a message
popup displaying the title of the page. If this code is run before the
title is loaded then it obviously is not going to work properly.
True.
so far I have this
<SCRIPT>
window.onload( alert(document.title) );
</SCRIPT>
window.onload=someFunction;
function someFunction(){
alert(document.title);
}

Had you bothered to read the group FAQ you wouldn't be asking this.
it pops up with a blank message. But when i use this code instead. It
will work provided I have it at the bottom of the page.

<SCRIPT>
alert(document.title);
</SCRIPT>
It will work anywhere *after* the title tag is presented.
So it seems that the onload is either not doing what it is supposed to
do or I am not using it properly. Any Ideas?


1) You are not using it properly.
2) Read the group FAQ.
3) Search the c.l.j archives.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #4

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

Similar topics

5
by: Amir K | last post by:
Hi I'm want to catch the event where WebBrowser Control finish loading a page after navigate. The problem with document_complete event is that if the site is multi-framed then the controls...
2
by: hbchai | last post by:
I'm adapting the ajax-like asynchronous request pattern mentioned in this article: http://www.xml.com/pub/a/2005/11/09/fixing-ajax-xmlhttprequest-considered-harmful.html?page=2 for my Sudoku...
6
by: theGreatGnu | last post by:
Hi all, I am new to PHP, Apache and Mysql. But I least I have managed to install everything on my home computer on my own and everything is up and running. I can fetch data from the database and...
2
by: Saint's Knight | last post by:
make progress bar while browser is loading page. ang when finish loading , show the page
0
by: Ronald S. Cook | last post by:
I have a Flash ActiveX object on my webpage and had that "Click here to activate this control" message. I implemented the solution using ieupdate.js and that problem goes away, but not my page...
4
by: fabrice | last post by:
I m looking for a solution to show a message when ma first page is loading. It is the "home page" of the application. And I'd like to give the message 'please waiting ...' during the loading. I...
1
by: Vlad | last post by:
Greetings: Here is scenario I hope to get help with. ASP.NET 1.1 page: page_load(){ ... btnSave.Attributes.Add("onclick", "MyClick()"); }
3
nev
by: nev | last post by:
i have included a splash using the properties option. the problem is i think my splash still loads but my startup form shows also. i would like to do something like... if splash finished...
6
by: vunet | last post by:
This may be a strange question from a non-technical person who asked me to make his whole site and images load all at once. I.e. the completely loaded site would show up immediately even with a big...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.