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.
  2.  
  3. with($('#image')) {
  4. src = src.replace(/\?.*$/, '') + '?' + Math.random();
  5. }

URL: http://johannburkard.de/blog/programming/javascript/6-fast-jQuery-Tips-More-basic-Snippets.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.