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)