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

Running javascript function after page renders in firefox?

cjl
Hey all:

I am preloading a large number of images for my web application, and I
want to display something indicating progress. So I am simply swapping
the visibility of an animated gif (which shows "Loading...") off after
the images are all loaded.

I am calling my preload function using:

<body onload="preload();>

This does not work. The images get preloaded, but the page does not
render at all until the images are preloaded.

What do I need to do so that the html of the page renders immediately
while the preload script is running?

My users will be required to use firefox in full-page mode, using the
autohide extension.

-cjl

Jul 23 '05 #1
4 2731


cjl wrote:

I am calling my preload function using:

<body onload="preload();>

This does not work. The images get preloaded, but the page does not
render at all until the images are preloaded.


That sounds very odd and I do not really believe that that is happening,
unless it has something to do with that extension you mention later.
Can you post a URL and tell us which version of Firefox you are
experiencing the problem with?
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
cjl
Martin:
That sounds very odd and I do not really believe that that is happening
Oh, it's happening. If I remove the onload call from the body tag, the
page loads and renders instantly. If I replace the onload call the
page will not render immediately, until all the images are preloaded.
unless it has something to do with that extension you mention later.
It happens with or without the extension.
Can you post a URL and tell us which version of Firefox you are
experiencing the problem with?


Firefox 1.0.4 for windows XP. I haven't been able to test it yet in
IE, due to some cross browser javscript incompatibilities I haven't
ironed out yet. I get the same problem with Mozilla.

Besides the images that are being preloaded, this page is super light
weight, only a few k of html and css. Without the preload function
onload, it renders instantly.

No URL, I don't have this stuff hosted yet. I'm working on that.

-CJL

Jul 23 '05 #3


cjl wrote:
If I remove the onload call from the body tag, the
page loads and renders instantly. If I replace the onload call the
page will not render immediately, until all the images are preloaded.


Very odd. Are those images on a different server than the HTML document?
Is there anything else (Flash or another plugin) on the page that needs
to load resources?
Post the URL when you have the stuff up on a public server.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4
cjl
Martin:

I stand corrected. Now that I have posted this to an actual web server
it no longer exhibits the improper behaviour. Oddly, this problem
(still) only occurs if I open the page locally.

My apologies to Martin, who didn't believe me, and was right not to.
You, sir, are a gentleman and a scholar.

Warning: Horrible HTML / CSS / Javascript ahead:
http://www.saintrays.net

Before mocking my design choices and coding abilities, keep in mind
that I am a doctor (radiologist) and not a programmer or designer. This
web app will be targeted to a very small group of people, and I will
require that they must view it in 'fullscreen' 1024 x 768 for it to
render correctly, hopefully in Firefox / Mozilla until I iron out the
IE bugs. It will be a sort of 'teaching file' of interesting cases
when finished. The fullscreen look is so that it can mimic the look of
powerpoint, without actually being as limiting as powerpoint. To see
what I mean, click on the "CR" button to load the plain film images,
and double click on an image. This zooms it. When zoomed, you can click
and drag to pan. Double clicking again zooms out. All of this is
impossible with powerpoint. Of course, a lot of functionality has yet
to be implemented.

Anyway, thanks again. Now to clean up the code, and add some actual
error checking to my functions.

-CJL

Jul 23 '05 #5

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

Similar topics

9
by: Astra | last post by:
Hi everybody Wonder if you could help me out. I created a simple JavaScript routine to enable a user to click backwards and forwards between small news articles. This routine works fine in IE...
2
by: jhcorey | last post by:
I'm using a javascript datepicker. In a sample html page, this datepicker is positioned on the page by adding the following script within an html element: <script type="text/javascript"> var...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
4
by: lmarceglia | last post by:
Hi, I have this website that doesn't work in Firefox 1.5: www.pianetaluca.com The HTML source is: <TITLE>PianetaLuca</TITLE> </HEAD>
7
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script...
11
by: Joey | last post by:
Hello, In my C# asp.net 2.0 application, I have a webform with a button server control on it. The webform, like most others in the site, subscribes to a master page. I have determined that the...
1
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET...
3
by: John Kotuby | last post by:
Hi all... I am trying to do a simple thing and maybe am missing something elementary. I have created a Javascript function at the top of a page which is meant to enable editing of an HTML input...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
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...

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.