謝晒的PHP網頁設計
聯絡E-mail:
sean0704@gmail.com
站內搜尋
Thursday, September 3, 2015
[JavaScript] 判斷使用者是否使用 IE 瀏覽器
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if(msie > 0) {
alert("This is IE.");
}
else if(!!navigator.userAgent.match(/Trident.*rv\:11\./)) {
alert("This is IE11.");
}
else {
alert("Others.");
}
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment