javascript image clientside

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • magister

    javascript image clientside

    Hello,

    Can anyone tell me with certainty?

    If I load a server-side image into a javascript image object.

    Is the image saved on the client, or does the page go back to
    the server when I do for instance an image swap?

    Thanks very much for feedback,
    yurps
  • Evertjan.

    #2
    Re: javascript image clientside

    magister wrote on 23 nov 2004 in comp.lang.javas cript:
    [color=blue]
    > Can anyone tell me with certainty?
    >
    > If I load a server-side image into a javascript image object.
    >
    > Is the image saved on the client, or does the page go back to
    > the server when I do for instance an image swap?
    >
    > Thanks very much for feedback,[/color]

    Remove the internet connection plug and try.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)

    Comment

    • Martin Honnen

      #3
      Re: javascript image clientside



      magister wrote:

      [color=blue]
      > Can anyone tell me with certainty?
      >
      > If I load a server-side image into a javascript image object.
      >
      > Is the image saved on the client, or does the page go back to
      > the server when I do for instance an image swap?[/color]

      Browsers usually have a cache where resources are downloaded to and
      stored for faster access. Of course images can be cached too and image
      preloading with
      var img = new Image();
      img.src = 'whatever.gif';
      indeed intends to cache the images.
      What a browser then exactly does when an image is accessed depends on
      various things, there are browser preferences for instance that set
      whether a resource can be loaded from the cache unchecked or whether the
      browser first needs to contact the server to find out whether the
      resource has been changed. And of course caches have a certain size so
      if you want to preload a lot of images not all might be cached.

      --

      Martin Honnen

      Comment

      Working...