Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #37592

Re: image refresh

Newsgroups comp.lang.javascript
Subject Re: image refresh
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <7vCdnZ7_BaCawTDAnZ2dnUU7-T_NnZ2d@westnet.com.au> <Bf6dnd23VeIW8zDAnZ2dnUU7-NnNnZ2d@westnet.com.au>
Date 2019-10-21 12:06 +0200
Message-ID <XnsAAEF7B2884437eejj99@194.109.6.166> (permalink)

Show all headers | View raw


Andrew Poulos <ap_prog@hotmail.com> wrote on 21 Oct 2019 in
comp.lang.javascript: 

> On 21/10/2019 6:19 pm, Andrew Poulos wrote:
>> I have an image that, when the page loads, loads a default image then 
>> (based on user input) creates and loads a different image. The user can
>> keep entering new input and the image created changes accordingly but 
>> the file name stays the same.
>> 
>> Is the "only" way to refresh just the image to change the src by adding
>> a time stamp eg. src = imgUrl + "?t=" + timestamp;
> 
> In my testing the first image that got created was
> 
> <img
> src="http:/ap_prog.com/exercises/ip3qexmgx1ektwx053sj/000000000000.png?t=
> 1571646597695" 
> 
> onerror="this.onerror=null; this.src=loc + 'images/imagenotfound.png'">
> 
> When the user inputs some data the image on the server changes but the 
> one in the page doesn't change - the console is showing src to have a 
> time stamp of 1571646786836 but the image is still the one with 
> 1571646597695.
> 
> How do I get it to reliably update?

<https://stackoverflow.com/questions/1077041/refresh-image-with-a-new-one-
at-the-same-url>


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

image refresh Andrew Poulos <ap_prog@hotmail.com> - 2019-10-21 18:19 +1100
  Re: image refresh Andrew Poulos <ap_prog@hotmail.com> - 2019-10-21 19:38 +1100
    Re: image refresh "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-10-21 12:06 +0200
  Re: image refresh Arno Welzel <usenet@arnowelzel.de> - 2019-10-21 16:34 +0200

csiph-web