check if history.pushState exists
This commit is contained in:
parent
2d7b8917cc
commit
b0000b5169
1 changed files with 6 additions and 2 deletions
|
@ -649,7 +649,9 @@ Ox.URL = function(options) {
|
||||||
@*/
|
@*/
|
||||||
that.pop = function() {
|
that.pop = function() {
|
||||||
if (self.previousURL) {
|
if (self.previousURL) {
|
||||||
history.pushState({}, self.previousTitle, self.previousURL);
|
history.pushState && history.pushState(
|
||||||
|
{}, self.previousTitle, self.previousURL
|
||||||
|
);
|
||||||
document.title = self.previousTitle;
|
document.title = self.previousTitle;
|
||||||
}
|
}
|
||||||
return !!self.previousURL;
|
return !!self.previousURL;
|
||||||
|
@ -681,7 +683,9 @@ Ox.URL = function(options) {
|
||||||
+ document.location.search
|
+ document.location.search
|
||||||
+ document.location.hash;
|
+ document.location.hash;
|
||||||
if (url != self.previousURL) {
|
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;
|
document.title = title;
|
||||||
callback && callback(state);
|
callback && callback(state);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue