Skip to content

Commit b16fb80

Browse files
author
zhangxinxu
committed
make ie9 can visit normal
make ie9 can visit normal
1 parent 31d0dc8 commit b16fb80

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

docs/docs.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
(function() {
2+
if (!document.getElementsByClassName) {
3+
return;
4+
}
5+
if (Mobilebone.support == false) {
6+
document.querySelector(".page.out").className = "page";
7+
}
28
var ele_version = document.getElementsByClassName("version");
39
[].slice.call(ele_version).forEach(function(version, index) {
410
version.innerHTML = "(v" + Mobilebone.VERSION + ")";

docs/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ <h2>mobilebone.js下载</h2>
3131
}
3232
});
3333
};
34-
Mobilebone.init();
34+
if (Mobilebone.support == false) {
35+
document.getElementById("indexPage").className = "page";
36+
}
3537
</script>
3638
</body>
3739
</html>

src/mobilebone.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
var supportHistory = "pushState" in history && "replaceState" in history;
3131

3232
Mobilebone.support = supportHistory;
33-
34-
if (supportHistory == false) return Mobilebone;
35-
33+
3634
var hasInited = false;
3735

3836
/**
@@ -119,6 +117,11 @@
119117
Mobilebone.pushStateEnabled = false;
120118
}
121119

120+
/**
121+
* if browser do not support history/classList, stop here
122+
**/
123+
if (supportHistory == false) return Mobilebone;
124+
122125

123126
/**
124127
* Function for transition

0 commit comments

Comments
 (0)