nysurf1
asked on
ajax question (forcing image refresh)
I have a function that calls a php page to rotate an image
********
var myurl = "rotate.php?img="+document .getElemen tById('r_i mg').value +"&r_dir=" +document. getElement ById('r_di r').value;
http.open("get", myurl, true);
http.onreadystatechange = rotateIt;
*********
That php page overwrites the image sent to it , rotates it 90 degrees and returns the same path of the image (after its been rotated and saved), when i get this image i refresh the src of the image
************
if (http.readyState == 4) {
document.getElementById(do cument.get ElementByI d('id_img' ).value).s rc=http.re sponseText ;
}
*************
What happens is that on the page the image shown is from the cach of the page (doesn't change) , if i delete the temporary files and refresh the page i see the new rotated image but i want it to be done without refreshing the page at all .
I guess one option is to rename the image when i rotate it , that could work but its a little complecated for me do do it now because all the images are stored in a database with some logic to their names so im hoping to find a simple solution that refreshes the cach of the image
Thanks!!
********
var myurl = "rotate.php?img="+document
http.open("get", myurl, true);
http.onreadystatechange = rotateIt;
*********
That php page overwrites the image sent to it , rotates it 90 degrees and returns the same path of the image (after its been rotated and saved), when i get this image i refresh the src of the image
************
if (http.readyState == 4) {
document.getElementById(do
}
*************
What happens is that on the page the image shown is from the cach of the page (doesn't change) , if i delete the temporary files and refresh the page i see the new rotated image but i want it to be done without refreshing the page at all .
I guess one option is to rename the image when i rotate it , that could work but its a little complecated for me do do it now because all the images are stored in a database with some logic to their names so im hoping to find a simple solution that refreshes the cach of the image
Thanks!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks ,
In the end i went with renaming the photo since the no-cache option is quite costly (its on a page with many images)
In the end i went with renaming the photo since the no-cache option is quite costly (its on a page with many images)
ASKER
thanks