GeezerButler wrote:
Quote:
I thought JS was purely on client side. |
You thought wrong. Have you got this idea through a (bad) book by any chance?
Quote:
But if i do myImage.src = 'someImageOnServer.gif", it seems to work. |
However, there is no contradiction here. The code is probably executed
client-side (there is an indication, but no necessity) which would make this
client-side script code. What resources a code accesses is not relevant in
order to decide where it is executed.
Client-side scripting frequently uses the capabilities of the Web client
that provides its execution environment.
Quote:
Is a request sent to the server when this line of code is executed? |
That much would seem to be obvious for resources provided by a HTTP server.
Quote:
If yes, then what kind of technique does JS use for loading this image. |
The capabilities of the Web client.
Quote:
OR Do browsers download all server images |
An HTML user agent does not distinguish between client and server. The
image is referenced by a URI or URI-reference, and the URI of the document
or the URI of the supposed image resource defines how the Web client is
acquiring the image data.
Quote:
when an initial server request is made, put it in some client side cache
and later JS accesses this cache. |
No. The Web client usually has a cache (in memory or on disk). Client-side
scripting can indirectly make use of this cache if it accesses features that
are handled by the Web client.
What other mechanism could be there?
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>