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

pre-loading images on the client browser

Hi
I have an application, which has to change to different images based on
some conditions. I am trying to call a javascript function(this
function changes the images on the front end) from the ASP script. I
want to preload all the images to the client side browser and point to
a different image source through the javascript.how do i do this in
javascript. any pointers appreciated
THanks

Sep 30 '05 #1
5 1853
va*********@gmail.com wrote:
Hi
I have an application, which has to change to different images based on
some conditions. I am trying to call a javascript function(this
function changes the images on the front end) from the ASP script. I
want to preload all the images to the client side browser and point to
a different image source through the javascript.how do i do this in
javascript. any pointers appreciated


Preloading images:
Search this group for 'preload images'. About 1,700 results are
returned. Sort by date and go from there...

Changing image src attribute:
Search this group for 'change image'. About 9,660 results are returned.
Sort by date and go from there... (some cover preloading too).

Use the above searches to get something working. Once it is close to
what you want but doesn't quite work, come back.
--
Rob
Sep 30 '05 #2
Hi,
I am able to preload the image and change the image on the client side.
But my requirement is i need to change this image from the server side
ie. from an ASP. is there any way to call client side javascript
functions/javascript variables from the ASP so that i can point
directly to the global array containing the preloaded images from the
javascript.

response.write "parent.content.ACUEq1.src = gsatimgarray[1].src ;"

where gsatimgarray is the array holding all the images on the client
side. Is there a way to update these images through javascript.
The above line doesnt seem to work

Sep 30 '05 #3
va*********@gmail.com wrote:
Hi,
I am able to preload the image and change the image on the client side.
But my requirement is i need to change this image from the server side
ie. from an ASP. is there any way to call client side javascript
functions/javascript variables from the ASP so that i can point
directly to the global array containing the preloaded images from the
javascript.
Seems you are in the wrong forum. JavaScript is almost exclusively a
client-side technology, and must be considered an extremely unreliable
one in terms of robust client-server application development (that is
not to say it can't be done in a well controlled environment, but there
are probably more suitable technologies).

response.write "parent.content.ACUEq1.src = gsatimgarray[1].src ;"

where gsatimgarray is the array holding all the images on the client
side. Is there a way to update these images through javascript.
The above line doesnt seem to work


What you are attempting is to 'push' data to the client. Such
architectures have been spectacularly unsuccessful on the web - though
they were all the rage for a while around 1996 or 1997.

Pushing data is against a fundamental premise of the web which is that
the client decides when it will get data from the server: the server has
no power at all to force a client to do anything.

You many include instructions in a page (e.g. using script or other
elements) that suggest that the client request information from the
server from time to time or when a user performs some action. The
client might (or might not) take notice of these suggestions.

--
Rob
Sep 30 '05 #4
wrote on 30 sep 2005 in comp.lang.javascript:
Hi,
I am able to preload the image and change the image on the client side.
But my requirement is i need to change this image from the server side
ie. from an ASP. is there any way to call client side javascript
functions/javascript variables from the ASP so that i can point
directly to the global array containing the preloaded images from the
javascript.

response.write "parent.content.ACUEq1.src = gsatimgarray[1].src ;"

where gsatimgarray is the array holding all the images on the client
side. Is there a way to update these images through javascript.
There is no ASP language!

Javasipt is not equivalent with clientside.

==========

So this is serverside javascript
containing a piece of clientside javascript::

response.write("parent.content.ACUEq1.src = gsatimgarray[1].src ;");

And this is serverside VBscript
containing a piece of clientside javascript::

response.write "parent.content.ACUEq1.src = gsatimgarray[1].src ;"

The serverside script renders/generates an clientside html that can
contain cclientside script, in javascript or any other language that the
browser can execute.

The serverside script is finished, when this resulting html is sent to
the client, so changing the ready clientside script by serverside script
is not possible.

============
The above line doesnt seem to work


The following are equivalent:

response.write "parent.content.ACUEq1.src = gsatimgarray[1].src ;"

and

%>
parent.content.ACUEq1.src = gsatimgarray[1].src ;
<%

So if the first is "Not working" [whatever that meant, you would have to
elaborate, showing error messages] the second is also "Not working"

So it must be a clientside problem.

Reducing the problem [for debugging reasons] to the html rendered [you
can get this by extracting it with viewsource on IE]
then you can set debugginf "breakpoints" like
alert(parent.content.ACUEq1.src);
and, if not successful, showing the html source to us [please only the
essentials], preferably as a link.

Then we can help.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Sep 30 '05 #5
RobG wrote:
va*********@gmail.com wrote:
I am able to preload the image and change the image on the client side.
But my requirement is i need to change this image from the server side
ie. from an ASP. is there any way to call client side javascript
functions/javascript variables from the ASP so that i can point
directly to the global array containing the preloaded images from the
javascript.


Seems you are in the wrong forum. JavaScript is almost exclusively a
client-side technology, and must be considered an extremely unreliable
one in terms of robust client-server application development (that is
not to say it can't be done in a well controlled environment, but there
are probably more suitable technologies).


ISTM you both want to read on ASP and NES basics.
PointedEars
--
Microsoft has been doing a really bad job on their OS. -- Linus Torvalds
Oct 16 '05 #6

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

Similar topics

2
by: GriffithsJ | last post by:
Hi I have been given some text that needs to be displayed on a web page. The text is pre-formatted (includes things like lists etc) and displays okay if I wrap it using the <pre/> tag. ...
21
by: Headless | last post by:
I've marked up song lyrics with the <pre> tag because it seems the most appropriate type of markup for the type of data. This results in inefficient use of horizontal space due to UA's default...
3
Pre
by: Neal | last post by:
A few questions about pre... When presenting preformatted text using the white-space: pre; property/value, Opera renders long lines at small viewport widths as exiting the borders of the...
7
by: Alan Illeman | last post by:
How do I set several different properties for PRE in a CSS stylesheet, rather than resorting to this: <BODY> <PRE STYLE="font-family:monospace; font-size:0.95em; width:40%; border:red 2px...
7
by: Roderik | last post by:
Hi, When I use <pre> inside my <td> cells, the text won't flow to a new line and the table gets to large in width. This will appear in Firefox this way, Internet Explorer will wrap the lines,...
2
by: Buck Turgidson | last post by:
I want to have a css with 2 PRE styles, one bold with large font, and another non-bold and smaller font. I am new to CSS (and not exactly an expert in HTML, for that matter). Is there a way to...
5
by: Michael Shell | last post by:
Greetings, Consider the XHTML document attached at the end of this post. When viewed under Firefox 1.0.5 on Linux, highlighting and pasting (into a text editor) the <pre> tag listing will...
8
by: Jarno Suni not | last post by:
It seems to be invalid in HTML 4.01, but valid in XHTML 1.0. Why is there the difference? Can that pose a problem when such a XHTML document is served as text/html?
7
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no...
23
by: Xah Lee | last post by:
The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations Xah Lee, 2006-03-15 Let me summarize: The LISP notation, is a functional notation, and is not a...
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: 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...
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
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,...

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.