1
A
回答
0
不久前發生在此博客文章。也許這是你在找什麼:http://blog.strictly-software.com/2009/03/detecting-ie-8-compatibility-modes-with.html
1
Determining Document Compatibility Mode
engine = null;
if (window.navigator.appName == "Microsoft Internet Explorer")
{
// This is an IE browser. What mode is the engine in?
if (document.documentMode) // IE8 or later
engine = document.documentMode;
else // IE 5-7
{
engine = 5; // Assume quirks mode unless proven otherwise
if (document.compatMode)
{
if (document.compatMode == "CSS1Compat")
engine = 7; // standards mode
}
// There is no test for IE6 standards mode because that mode
// was replaced by IE7 standards mode; there is no emulation.
}
// the engine variable now contains the document compatibility mode.
}
+0
這隻會告訴我正在使用什麼引擎。如果網頁使用兼容性模式,則IE的版本會在useragent上發生變化,因此無法確定當前版本(關閉兼容模式)與引擎之間是否存在差異。 – 2011-04-07 13:41:23
+0
這個方法看起來很不錯,但是IE9和IE10需要增強代碼(以上)。這裏有一些更重要的信息:http://msdn.microsoft.com/en-us/library/cc288325%28VS.85%29.aspx – djangofan 2012-12-03 17:39:20
相關問題
- 1. 如何檢查IE11是否在使用JS的兼容性視圖中
- 2. HTML5/JS:檢查視頻兼容性
- 3. C#Gmail兼容性視圖
- 4. IE9兼容性視圖
- 5. 函數檢查CSS/Pop-up/cookies/javascript /瀏覽器兼容性是否啓用
- 6. 是什麼導致IE瀏覽器檢測兼容性視圖
- 7. IE9是否保留「兼容性視圖」按鈕?
- 8. JavaScript兼容性庫
- 9. IE8不會在「兼容性視圖」中加載JavaScript文件。
- 10. 檢查UIImage是否在視圖頂部
- 11. 檢查活動是否存在視圖
- 12. 檢查文本視圖是否在android
- 13. 客戶端兼容性檢查管理
- 14. ABI兼容性頭/庫交叉檢查
- 15. Dojo瀏覽器兼容性檢查?
- 16. 編程檢查IIS7兼容性角色是否在IIS7中啓用/禁用
- 17. mvc - 模型視圖命名兼容性
- 18. jQuery和IE8兼容性視圖
- 19. 如何強制兼容性視圖
- 20. Internet Explorer兼容性視圖/ IIS7問題?
- 21. IE11兼容性視圖TEXTAREA maxLength
- 22. 工具/實用程序/資源檢查兼容性的javascript
- 23. 如何檢查ViewModel的屬性在視圖中是否爲空?
- 24. Django檢查JavaScript是否在
- 25. JavaScript檢查屬性是否定義
- 26. json是否有兼容性問題?
- 27. 檢測是否安裝了IIS 6.0元數據庫兼容性
- 28. 使用x-ua兼容元標記是否影響Javascript性能?
- 29. javascript兼容性問題
- 30. Javascript IN操作兼容性
可能重複:http://stackoverflow.com/questions/1328963/detect-ie8-compatibility-mode – Andrei 2011-04-07 12:32:12
是的,但沒有這些答案解釋瞭如何獲得兼容性模式按鈕(它出現在URL字段右側的書籤星標旁邊)。他們只是解釋如何檢測它。如果可以啓用該按鈕,則用戶將能夠輕鬆地點擊該按鈕來切換共享模式而不需要進入菜單。 – djangofan 2012-12-03 17:37:28
看到這個問題http://stackoverflow.com/questions/1328963/detect-ie8-compatibility-mode – 2011-04-07 12:33:33