js基础10

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>BOW</title>
	<script type="text/javascript">
		function print(message){
			document.write(message);
			document.write("<br>");
			document.write("<br>");
		}
		//浏览器
		print("浏览器的名称是:"+navigator.appName);
		print("浏览器的版本是:"+navigator.appVersion);
		print("浏览器的内部代码是:"+navigator.appCodeName);
		print("操作系统:"+navigator.platform);
		print("是否启用cookies:"+navigator.cookieEnabled);
		print("浏览器的用户代理报头:"+navigator.userAgent);
		//屏幕
		print("用户的屏幕分别率:"+screen.width+"*"+screen.height);
		print("用户的可用频率分别率:"+screen.availWidth+"*"+screen.availHeight);	
		//location
		print("协议"+location.protocal);
		print("主机名:"+location.hostname);
		print("端口号:"+location.port);
		print("主机加端口号:"+location.host);
		print("访问的路径:"+location.pathname);
		print("锚点:"+location.hash);
		print("参数列表:"+location.search);
	</script>
</head>
<body>		
</body>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_43293451/article/details/91391890