2016-04-25 39 views
0

我想檢查用戶的瀏覽器是否支持semantic-ui功能,並在頁面頂部顯示錯誤消息,但允許用戶繼續使用網站。semantic-ui javascript:如何檢查支持的瀏覽器?

那麼semantic-ui裏面的任何函數都會檢查當前瀏覽器是否可以使用語義,或者檢查用戶的瀏覽器是否壞,如isSemanticUiSupportThisBrowser()

我試圖從這裏grep來源https://github.com/Semantic-Org/Semantic-UI通過find . -name "*.js" -exec grep -i browser {} \; -print,但找不到任何類似於我想要的功能。

+1

這可能會回答你的問題https://github.com/Semantic-Org/Semantic-UI/issues/4#issuecomment-30446129 – Ozrix

+0

這很舊了。超級老。他們不再支持IE9。 – user2867288

回答

1

據我所知,語義UI不提供此功能。

它們確實提供了支持的瀏覽器列表。 https://github.com/Semantic-Org/Semantic-UI

Browser Support 
    Last 2 Versions FF, Chrome, Safari Mac 
    IE 11+ 
    Android 4.4+, Chrome for Android 44+ 
    iOS Safari 7+ 

檢查其他主題,如How can you detect the version of a browser?的瀏覽器嗅探。

您可以使用諸如modernizr(https://modernizr.com/)之類的庫來進行特徵嗅探,但是您需要完成這項工作來確定您正在嗅探哪些特徵。

相關問題