Jump to content

Is it possible to...


Don E

Recommended Posts

Hello everyone, I was wondering if it's possible to update an image on a webpage without having to refresh the page so that the updated image can be displayed? I know that ajax will be involved and I have tried it but when echoing the new image in the PHP that process/makes changes to the image, it doesn't display the new updated image. I did a bit of searching and some have said the update may not be taking place because the 'cached' version of the image is being displayed? I'm not sure. The only way I was able to get this to work is when after processing the image, I have the browser refresh using: window.location.reload(); Any input is greatly appreciated, thanks!

Link to comment
Share on other sites

Thanks JSG. When I try the following in the ajax call to the image modifying script:

echo '<img id="image" src="../uploads/' . $_SESSION['picName'] . '?d=' . time() . '" alt="Image" />';

.. it doesn't append to the file and no image is displayed. Maybe I'm not appending correctly? (Note: $_SESSION['picName'] is just contains the name of the image, like: mypic.jpg) Thanks again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...