判断浏览器的类型
浏览器 类型 判断
2023-09-14 09:13:42 时间
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>判断浏览器的类型</title>
<script src="jquery-1.8.3.min.js"></script> <!-- 引入合适的jq -->
</head>
<body>
<div class="">判断浏览器的类型</div>
</body>
<script>
$(document).ready(function() {
// If the browser type if Mozilla Firefox
if ($.browser.mozilla && $.browser.version >= "1.8" ){
// some code
}
// If the browser type is Opera
if( $.browser.opera)
{
alert(1);
// some code
}
// If the web browser type is Safari
if( $.browser.safari )
alert(2);
{
// some code
}
// If the web browser type is Chrome
if( $.browser.chrome)
alert("我是谷歌");
{
// some code
} //以上浏览器判断都是可以的
// If the web browser type is Internet Explorer
if ($.browser.msie && $.browser.version <= 6 )
alert(4);
{
// some code
}
//If the web browser type is Internet Explorer 6 and above
if ($.browser.msie && $.browser.version > 6)
alert(5);
{
// some code
}
});
</script>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>判断浏览器的类型</title>
<script src="jquery-1.8.3.min.js"></script> <!-- 引入合适的jq -->
</head>
<body>
<div class="">判断浏览器的类型</div>
</body>
<script>
$(document).ready(function() {
// If the browser type if Mozilla Firefox
if ($.browser.mozilla && $.browser.version >= "1.8" ){
// some code
}
// If the browser type is Opera
if( $.browser.opera)
{
alert(1);
// some code
}
// If the web browser type is Safari
if( $.browser.safari )
alert(2);
{
// some code
}
// If the web browser type is Chrome
if( $.browser.chrome)
alert("我是谷歌");
{
// some code
} //以上浏览器判断都是可以的
// If the web browser type is Internet Explorer
if ($.browser.msie && $.browser.version <= 6 )
alert(4);
{
// some code
}
//If the web browser type is Internet Explorer 6 and above
if ($.browser.msie && $.browser.version > 6)
alert(5);
{
// some code
}
});
</script>
</html>
相关文章
- 前端学习笔记———浏览器篇
- 离线应用的福音-浏览器数据库indexdb
- 谷歌浏览器:Unchecked runtime.lastError: The message port closed before a response was received
- And Design5 360安全浏览器样式错乱问题解决
- 浏览器第四种语言-WebAssembly
- web 页面在浏览器运行eval性能分析和优化
- JavaScript获取浏览器类型与版本详解编程语言
- JS如何判断浏览器类型和详细区分IE各版本浏览器详解编程语言
- IE浏览器将在Windows 11系统中被彻底禁用
- 跨浏览器的实践:position:fixed层的固定定位
- javascript检测浏览器类型和版本的代码
- js无提示关闭浏览器页面的代码
- JS判断浏览器类型与版本的实现代码
- js判断浏览器类型为ie6时不执行
- 使用jQuery不判断浏览器高度解决iframe自适应高度问题
- javascript的document.referrer浏览器支持、失效情况总结
- javascript实现获取浏览器版本、操作系统类型