tags:

views:

727

answers:

1

Hi!

I'm in trouble - very often when I update url of the images, browser not update them (in hosted mode, firefox)

img.setUrl("..."); // sometimes won't work

Ok, I try to instantiate new Image every time I need update url. I Use img = new Image("..."); on my SimplePanel.

In hosted mode ot works, but in firefox - won't, when I press shift+refresh when reloading page (with clearing the cache).

Hacks like DOM.setElementAttribute(Image.getElement(), "src", path); won't help.

+1  A: 

I used to have trouble with the browser not updating an image if I set it to a url that had already been loaded. Since it had already been loaded, the browser just displayed what was in the cache. I'm not sure if this is exactly the same problem you're having, but I got around mine by using the url + "?" + aRandomNumber, causing the browser to reload the image instead of pull from the cache.

DLH
Sounds like a caching issue for sure.
Carnell