BOM属性

来源:互联网 发布:力度exp5000编程方法 编辑:程序博客网 时间:2024/06/01 09:41


<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<script>
//window.navigator.userAgent : 浏览器信息

//alert( window.navigator.userAgent )

if ( window.navigator.userAgent.indexOf('MSIE') != -1 ) {
 alert('我是ie');
} else {
 alert('我不是ie');
}
</script>
</head>

<body>
</body>
</html>




<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<script>
//window.location : 地址
/*
window.location.href = window.location内容
window.location.search = url?后面的内容
window.location.hash = url#后面的内容
*/

//alert( window.location );

//alert( window.location.href );//地址

//alert( window.location.search );

//alert( window.location.hash );
</script>
</head>

<body>
</body>
</html>




<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<script>
window.status = 'maiov';
//alert( window.status );
</script>
</head>

<body>
</body>
</html>



0 0