1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | (function () {
|
12 | 'use strict';
|
13 |
|
14 | function emulatedIEMajorVersion() {
|
15 | var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent)
|
16 | if (groups === null) {
|
17 | return null
|
18 | }
|
19 | var ieVersionNum = parseInt(groups[1], 10)
|
20 | var ieMajorVersion = Math.floor(ieVersionNum)
|
21 | return ieMajorVersion
|
22 | }
|
23 |
|
24 | function actualNonEmulatedIEMajorVersion() {
|
25 |
|
26 |
|
27 |
|
28 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')()
|
29 | if (jscriptVersion === undefined) {
|
30 | return 11
|
31 | }
|
32 | if (jscriptVersion < 9) {
|
33 | return 8
|
34 | }
|
35 | return jscriptVersion
|
36 | }
|
37 |
|
38 | var ua = window.navigator.userAgent
|
39 | if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) {
|
40 | return
|
41 | }
|
42 | var emulated = emulatedIEMajorVersion()
|
43 | if (emulated === null) {
|
44 | return
|
45 | }
|
46 | var nonEmulated = actualNonEmulatedIEMajorVersion()
|
47 |
|
48 | if (emulated !== nonEmulated) {
|
49 | window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!')
|
50 | }
|
51 | })();
|