Skip to content

Instantly share code, notes, and snippets.

@kamilogorek
Created August 28, 2013 14:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kamilogorek/6366596 to your computer and use it in GitHub Desktop.
Save kamilogorek/6366596 to your computer and use it in GitHub Desktop.
window.changeURL = function(photo) {
// not HTML history API browsers
if ($('html').hasClass('ie8') || $('html').hasClass('ie9')) {
window.location = photo.url;
}
else {
var stateObj = { video: 'xfactor' };
history.pushState(stateObj, photo.description, photo.url);
}
};
PhotosViewer.prototype.changeURL = function (stateObj, url, title) {
// not HTML history API browsers
if (!Modernizr.history) {
window.location = photo.url;
return;
}
history.pushState(stateObj, title, url);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment