Welcome Guest, Not a member yet? Register   Sign In
[solved] changing images with jquery
#1

[eluser]SPeed_FANat1c[/eluser]
I change images in my div container using this line:

Code:
$('div.foto').html('<img src="'+ CI.base_url + 'uploads/darbuotojai/' + response + '"/>');

response variable is the file name.

The user first time uploads image file with ajax. The file is renamed to 'worker.jpg'. Then it is shown in web page.
Then user decides to change the file - uploads another. The file is renamed to 'worker1.jpg' because there exists already 'worker.jpg'. The 'worker1.jpg' is shown on the webpage. The 'worker.jpg' is removed from server.
And then the user decides once more to change the file. So he uploads againg, and the file gets name 'worker.jpg' - the one which was the first time, because this file name is free now, there is no more such name in the server. Then show that file.
And the problem - the browser shows that file which was uploaded for the first time, which is removed from server. It remembers it. How to make it show the new file which is with the same name? In other words browser should get new file instead of using old.


Messages In This Thread
[solved] changing images with jquery - by El Forum - 01-03-2011, 08:22 AM
[solved] changing images with jquery - by El Forum - 01-03-2011, 08:54 AM
[solved] changing images with jquery - by El Forum - 01-03-2011, 09:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB