Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    19
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Browser keep the image when the source is changed

    Hi, I have a strange problem!
    I put an img in the browser say <img src='abc.png'>.
    When I change the image (keep the same name) and then refresh the window. The browser displayed the original image. How to let the browser display the new image?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    How to let the browser display the new image?
    It's due to the caching of files by the browser. You may solve this by a hard refresh (Ctrl+F5). Or simple add different numbers or string at the end of file name, like
    Code:
    <img src='abc.png?1'>
    <img src='abc.png?2'>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    cdzhang (06-14-2012)

  • #3
    New Coder
    Join Date
    Mar 2012
    Posts
    19
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thank you very much, this works pretty well! use let $_SESSION['logo_tail'] add 1 every the time the user refresh the window.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •