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

loading order

When I have something like this in a js file.
listeImg = new Array();
listeImg[1] = new Image(w,h);
listeImg[1].src = "centre1.jpg";
etc

Are the images loaded after the page is loaded? In the same time? Before the
page is loaded? The browser decision?
If the visitors goes, before the procedure is over, to another page having
a link to the same js file, will the other page allows for the rest of the
images to be loaded?

function caheImages(){
listeImg[1].src = "centre1.jpg";
etc.
}
If i put theese in a function called by an onLoad =caheImages() event. Will
the loading pursue on the second page where the first page loading process
left over?

Thanks for your attention.
Jean Pierre Daviau
--
Easyphp1.8
Apache1.3.24
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
http://www.jeanpierredaviau.com
Feb 27 '06 #1
2 2961
Jean Pierre Daviau wrote:
When I have something like this in a js file.
listeImg = new Array();
listeImg[1] = new Image(w,h);
listeImg[1].src = "centre1.jpg";
etc

Are the images loaded after the page is loaded? In the same time? Before the
page is loaded? The browser decision?
If the above statements are not inside a function, they will be executed
when the browser gets to them. Loading of the images will start then
and will proceed at a pace determined by the connection and browser
settings.

If they are inside a function that is called from an onload event, then
loading will proceed from when the function is called.

If the visitors goes, before the procedure is over, to another page having
a link to the same js file, will the other page allows for the rest of the
images to be loaded?
Once a new page starts loading, everything from the old page is dumped
other than data that has been cached. Any script that was executing or
data that was being downloaded from the first page will stop, including
loading of the images.

The second page will start to load the same images and may take
advantage of data that has already been cached (or not, depending on
settings and a variety of other factors). JavaScript has little or no
control over any of that.

function caheImages(){
listeImg[1].src = "centre1.jpg";
etc.
}
If i put theese in a function called by an onLoad =caheImages() event. Will
the loading pursue on the second page where the first page loading process
left over?


Only to the extent that the second page can take advantage of what has
been cached previously. You, as a JavaScript programmer, can't direct
the second page to pickup where the first page left off or to use cached
images in preference to those on the server. There are other techniques
to provide hints to the browser to cache stuff but you can't be certain
that it will happen.
--
Rob
Feb 27 '06 #2

"RobG" <rg***@iinet.net.au> a écrit dans le message de news:
AB*****************@news.optus.net.au...
You, as a JavaScript programmer, can't direct the second page to pickup
where the first page left off or to use cached images in preference to
those on the server. There are other techniques to provide hints to the
browser to cache stuff but you can't be certain that it will happen.

Would an onBeforeUnload event in the first page would be sufficient to throw
that information with the url?lastloadedImage=3
or
a for loop testing for image complete in the second page

Where can I get info on that. I have red the Fith editon of Dany Goodman
book ... and did not find precise information on what you are .

Thanks again
Feb 28 '06 #3

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

Similar topics

1
by: Stacey | last post by:
Hi, I'm hoping for a bit of advise-- I have a (relatively, from the point-of-view of this dilettante) complex script that attempts to preload certain images in order to trigger one of a series of...
4
by: zborisau | last post by:
Hey good people, I've been given a problem to solve recently - and stuck with the solution for a good 4 days already. i have a link which leads to popup window. the purpose of that popup...
0
by: Deep Purple | last post by:
I started with the following error... ------------------------------------------------------- An error occured while loading the schema with TargetNamespace 'http://www.w3.org/2001/XMLSchema'...
1
by: sasan3 | last post by:
I have a main form "topform" contaning "subform1" and "subform2" The goal is: I need to requery subform2 on CURRENT event of subform1, and I need to load subform2 contents based on settings on...
3
by: Seth Broomer | last post by:
Hi, i have a .aspx Page, inside that page is a web user control. The user control is basically a login control. if the user is logged in the page shows one thing. if the user isn't logged in...
1
by: John Smith | last post by:
Hey folks, Got a weird one for you that I think may just be a bug with Internet Explorer. I have a page that hosts an IFrame. When I call Javascript in my page to change the source of the...
1
by: aj | last post by:
DB2 WSUE LUW v8.2 FP4 (aka v8.1 FP11) RHEL AS 4 I am EXPORTing in IXF format from one schema and then LOADing into another schema. The DB modeling tool I am using likes to put the PK columns...
27
by: Chris Tomlinson | last post by:
Hi, is there any way to specify the sequence in which images load on a web page? More specifically, here is what we need to achieve: Image1 starts loading first and the browser does not...
8
by: Michael R | last post by:
Hi everyone. I have a few subforms in the main form that are dependent on each other with their data (not with child/master fields). Sometimes I get an invalid reference error because the...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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?
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...

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.