• javascript BOM对象 第15节


    <html>
    <head>
    	<title>浏览器对象</title>
    	
    	<script type="text/javascript">
    	 var  a = 20;//声明变量 函数  对象 属于window对象
    	 //alert(window.a);
    	 function  test () {
                  alert("window对象函数");
    
    	 }
    	 //window.test();//函数调用
    	
    	</script>
    	
    	</head>
    	<body>		
    		<div>BOM对象</div>
    
    		1.navigator<br/>
    			<script type="text/javascript">
    
    			 for ( var name in navigator  )
    			 { 
    				 document.write(name ," : " ,navigator[name], "<br/>");
    			 }
    			     
    			</script>
    
    		2.screen<br/>
    			<script type="text/javascript">
    
    			 for ( var name in screen )
    			 { 
    				 document.write(name ," : " , screen[name], "<br/>");
    			 }
    			     
    			</script>
    
    		3.history<br/>
    			<script type="text/javascript">
    
    			</script>
    			<a href="浏览器对象.htm" target="_self">浏览器对象</a>
    			<input type="button" value="向前" onclick="history.forward()"/><br/>
    
    		4.location<br/>
    			<script type="text/javascript">
    				document.write("location.host : ", location.host, "<br/>");
    				document.write("随机数 : ", Math.round(Math.random() * 100), "<br/>");
    			</script>			
    			<input type="button" value="换页1" onclick="location.href='浏览器对象.htm'"/>
    			<input type="button" value="换页2" onclick="location='浏览器对象.htm'"/>
    			<input type="button" value="刷新" onclick="location.reload()"/>
    			<input type="button" value="替换" onclick="location.replace('内置对象.htm')"/>
    			<input type="button" value="转向" onclick="location.assign('内置对象.htm')"/>
    
    	</body>
    
    </html>
    

     rs:

    2.

  • 相关阅读:
    Web开发(二)HTML
    Web开发(一)基础
    Python基础(十二)并发编程02
    Python基础(十一)并发编程01
    Python基础(十)socket编程
    Python基础(九)异常
    计算机基础
    Python基础(八)面向对象02
    jmeter使用正则表达式提取数据
    jmeter+ant 实现自动化接口测试环境配置
  • 原文地址:https://www.cnblogs.com/feilongblog/p/4741978.html
Copyright © 2020-2023  润新知