Reload an image with jQuery

/ Published in: JavaScript
Save to your folder(s)

Copy this code and paste it in your HTML
  1. // There is no reload or replace method for images. The src property can be set in the same way as the location.href property though.
  3. with($('#image')) {
  4. src = src.replace(/\?.*$/, '') + '?' + Math.random();
  5. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.