Skip to content

Instantly share code, notes, and snippets.

@jonnii
Created October 11, 2012 16:40
Show Gist options
  • Save jonnii/3873727 to your computer and use it in GitHub Desktop.
Save jonnii/3873727 to your computer and use it in GitHub Desktop.
awful hack
$('.button').each(function () {
var location = $(this).attr('href');
$(this).click(function (e) {
var image = $('<img/>');
image.error(function () {
window.location = location;
}).load(function () {
window.location = location;
}).attr('src', location);
e.preventDefault();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment