1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
| var Detect = {
| ieVer: 9.0,
|
| teVer: 7.0,
|
| sgVer: "66",
|
| detectIE: function () {
| var isIE = !!window.ActiveXObject || "ActiveXObject" in window;
| if (!isIE) {
| alert("请使用含有 IE核心 的浏览器!");
| return false;
| }
|
| var ieVer = this.getIEVer();
| if (ieVer < this.ieVer) {
| alert("请使用 IE " + this.ieVer + " 或 更高版本!");
| return false;
| }
|
| var flag = this.detectTE();
| if (!flag) {
| return false;
| }
|
| return true;
| },
|
| getIEVer: function () {
| var agent = window.navigator.userAgent.toLowerCase();
| var msie = agent.indexOf("msie ");
| if (msie > -1) {
| return parseFloat(agent.substring(msie + 5, agent.indexOf(";", msie)));
| }
|
| return 11;
| },
|
| detectTE: function () {
| try {
| var sg = this.getSG();
| if (sg == null) {
| return false;
| }
|
| //var test = new ActiveXObject("TEDetect.TETest"); if (!test || test.Type == "NA") return false;
| var ver = parseFloat(sg.Version.Major + "." + sg.Version.Minor);
| if (ver < this.teVer) {
| alert("请使用 Skyline Globe " + this.teVer + " 或 更高版本!");
| return false;
| }
|
| if (ver >= 7.4) {
| this.sgVer = "74";
| } else if (ver >= 7.1) {
| this.sgVer = "71";
| } else if (ver >= 7) {
| this.sgVer = "70";
| } else {
| this.sgVer = "66";
| }
|
| return true;
| } catch (e) {
| console.error(e);
| }
|
| return false;
| },
|
| getSG: function () {
| return TEWinEx.CreateInstance("TerraExplorerX.SGWorld" + this.sgVer);
| }
| };
|
|