473,287 Members | 1,663 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,287 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 2953
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.