check if history.pushState exists

This commit is contained in:
rolux 2012-05-25 19:58:43 +02:00
parent 2d7b8917cc
commit b0000b5169

View file

@ -649,7 +649,9 @@ Ox.URL = function(options) {
@*/
that.pop = function() {
if (self.previousURL) {
history.pushState({}, self.previousTitle, self.previousURL);
history.pushState && history.pushState(
{}, self.previousTitle, self.previousURL
);
document.title = self.previousTitle;
}
return !!self.previousURL;
@ -681,7 +683,9 @@ Ox.URL = function(options) {
+ document.location.search
+ document.location.hash;
if (url != self.previousURL) {
history.pushState(Ox.extend(state, {title: title}), '', url);
history.pushState && history.pushState(
Ox.extend(state, {title: title}), '', url
);
document.title = title;
callback && callback(state);
}