HighDots Forums  

Basic questions about JS images

Javascript JavaScript language (comp.lang.javascript)


Discuss Basic questions about JS images in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
GeezerButler
 
Posts: n/a

Default Basic questions about JS images - 06-01-2008 , 03:03 PM






I thought JS was purely on client side. But if i do myImage.src =
'someImageOnServer.gif", it seems to work.
How does JS do this?
Is a request sent to the server when this line of code is executed? If
yes, then what kind of technique does JS use for loading this image.
OR
Do browsers download all server images when an initial server request
is made, put it in some client side cache and later JS accesses this
cache.
OR
some other mechanism?

Reply With Quote
  #2  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Basic questions about JS images - 06-01-2008 , 04:23 PM






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.

Quote:
How does JS do this?
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.

Quote:
OR some other mechanism?
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>


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.