473,406 Members | 2,713 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,406 software developers and data experts.

Display same image on a page multiple times

yk
Hi,

Is it a technique available in html/javascript in order to display same

image many many times on a same page? Because of a large page loading
I am looking for a way not to have same image many times in a page
load, but rather once.

Yefim

Sep 12 '06 #1
6 9244
yk wrote on 12 sep 2006 in comp.lang.javascript:
Hi,

Is it a technique available in html/javascript in order to display same

image many many times on a same page? Because of a large page loading
I am looking for a way not to have same image many times in a page
load, but rather once.
In most browsers, perhaps in all, an image loads only once when displayed
multiple times on the same page.

No need for scripting.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 12 '06 #2
ASM
Evertjan. a écrit :
yk wrote on 12 sep 2006 in comp.lang.javascript:
>Is it a technique available in html/javascript in order to display same
image many many times on a same page? Because of a large page loading
I am looking for a way not to have same image many times in a page
load, but rather once.
a simple css style ?

<style type="text/css">
img.img {
width: 75px; height: 125px;
background: url(folder/image.png) norepeat center center #fff;
}
</style>
<img src="" class="img" alt="virtual image" title="" id="i_0" />
<img src="" class="img" alt="virtual image" title="" id="i_1" />
<img src="" class="img" alt="virtual image" title="" id="i_2" />
<img src="" class="img" alt="virtual image" title="" id="i_3" />
<img src="" class="img" alt="virtual image" title="" id="i_4" />

Craftiness (but not W3C valid) :
http://stephane.moriaux.perso.orange.fr/truc/boul_clic3
(exercise about slide-doors in css+js - click on bulls)
http://stephane.moriaux.perso.orange.fr/truc/boulier_js
(application : same images)

--
Stephane Moriaux et son [moins] vieux Mac
Sep 12 '06 #3
Evertjan. wrote:
yk wrote on 12 sep 2006 in comp.lang.javascript:
>Is it a technique available in html/javascript in order
to display same image many many times on a same page?
Because of a
large page loading I am looking for a way not to have
same image many times in a page load, but rather once.

In most browsers, perhaps in all, an image loads only
once when displayed multiple times on the same page.
Wouldn't that depend a great deal on the HTTP headers sent with the
image? If the headers suggested that the image expired immediately (or
in the past), or should not be cached, then it may be re-fetched from
the server for each request. (Browser cache configuration would also be
a factor in conjunction with headers).

But even in a best case of the image being cached on the client hard
disk the actual image data is going to have to be transferred to display
memory multiple times, but that cannot be avoided if the user is to see
the image in multiple places at once.
No need for scripting.
None.

Richard.
Sep 12 '06 #4
Richard Cornford wrote on 13 sep 2006 in comp.lang.javascript:
Evertjan. wrote:
>yk wrote on 12 sep 2006 in comp.lang.javascript:
>>Is it a technique available in html/javascript in order
to display same image many many times on a same page?
Because of a
large page loading I am looking for a way not to have
same image many times in a page load, but rather once.

In most browsers, perhaps in all, an image loads only
once when displayed multiple times on the same page.

Wouldn't that depend a great deal on the HTTP headers sent with the
image?
If the headers suggested that the image expired immediately (or
in the past), or should not be cached, then it may be re-fetched from
the server for each request.
You are right, never thought about that, Richard.

I must remember this and think up a use for manipulating image headers.
Perhaps in a page counter? Well, there are better totally serverside ways
for that.
(Browser cache configuration would also be
a factor in conjunction with headers).
"most browsers" are used "out of the box".
But even in a best case of the image being cached on the client hard
disk the actual image data is going to have to be transferred to
display memory multiple times, but that cannot be avoided if the user
is to see the image in multiple places at once.
I believe that is not the kind of loading ment in the OQ ;-}
>No need for scripting.

None.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 13 '06 #5
Evertjan. wrote:
Richard Cornford wrote on 13 sep 2006 in comp.lang.javascript:
<snip>
>(Browser cache configuration would also be
a factor in conjunction with headers).

"most browsers" are used "out of the box".
But development browser often have caching settings altered so that
updated work-in-progress is loaded from the server rather then having
old version retrieved from the cache. Those setting will also influence
image loading, and so if not fully understood may give the impression
that images are being continually downloaded when in real world
browsers there may be no issue.

Richard.

Sep 13 '06 #6
Richard Cornford wrote on 13 sep 2006 in comp.lang.javascript:
Evertjan. wrote:
>Richard Cornford wrote on 13 sep 2006 in comp.lang.javascript:
<snip>
>>(Browser cache configuration would also be
a factor in conjunction with headers).

"most browsers" are used "out of the box".

But development browser often have caching settings altered so that
updated work-in-progress is loaded from the server rather then having
old version retrieved from the cache. Those setting will also influence
image loading, and so if not fully understood may give the impression
that images are being continually downloaded when in real world
browsers there may be no issue.
Mmmmmmmmmmmmmmmyyy... Yes!
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 13 '06 #7

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

Similar topics

5
by: david | last post by:
Can I use WriteFile methods? It seems that it does not work. For example, the following code only dispay one figure. Response.WriteFile("images/image002.jpg") Response.Write("<br><p>")...
2
by: Adam | last post by:
I have extensively searched for a solution. Below is my code that is contained in an aspx. When my browser hits this aspx, I just get the standard broken image picture. I know the data is the...
4
by: Milkstr | last post by:
I want to be able to display the same image a number of times, according to how is set by my database that drives the page. I have database of top goal scorers, i know how to display a list of the...
18
by: fishwick | last post by:
I haven't really done any css in quite a while, and am banging my head against the wall trying get the rudimentary layout together of a church website home page to display correctly - I don't want...
1
by: rajbala.3399 | last post by:
Hai all, I need to get multiple image buttonsand wheni click on the image button it should display corresponding image on window and if i click another image button it is also display on same...
7
by: eholz1 | last post by:
Hello Group, Perhaps you can help me. I have a mysql db, that holds images. Images are encoded using base64_decode/encode, etc. Image data seems fine. I have a view.php page that is supposed...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
3
by: Dave | last post by:
I have an ASP 3.0 website on which the images are displaying intermittently. In other words, when I request a page, the image is blank. There is no missing image place marker (rectangle with a...
20
by: thulaseeram | last post by:
Hi to All, Here i have the same image stored in the db with different id's and also exist some other images. Here i have to display banner randomly i have taken imageid's and displayed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
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...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...

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.