I have a field that calls img, in it I record the name of the image, for example: 001.jpg, where "1" corresponds to the record ID.
I have a routine that changes the image and is working, the change is made by jQuery and ASP.
But when I change the image, the routine saves with the same name, that is, delete the previous image and save the new one with the same name: 001.jpg
This is where the problem is: I get the src
attribute via jQuery, it's working because I put a test and changed the name, however the name is not changed and only the image in the folder.
That is, as src
is not changed the image also does not change.
And if I change the name of the image in the database gives the same, why imagine the situation:
figura atual: 001.jpg
figura nova : 001-x.jpg
There the last one was in the database and when I make the change, it will be changed again to 001-x.jpg or it will never change the src
attribute.
Am I in the right logic or is something missing?
What I've done:
$.ajax({ url: "usuarios-acoes.asp?IdReg=" + IdReg + "&Acao=" + Acao + "&nomeUsu=" + nomeUsu, dataType: "html", success: function(result) { if (result == "N") {} else { $('#IdUsuarioImg').val(''); $('#titNomeModalImg').html(''); $('#img-peq-usu-' + IdReg).attr('src', result); $('#img-gde-usu-' + IdReg).attr('src', result); } }, error: function() { $('#IdUsuarioImg').val(''); $('#titNomeModalImg').html(''); } });