JavaScript学习笔记14

location()

		document.write("<h3>location对象</h3>");
		document.write("<br>主机名"+location.hostname +"<br>");
		document.write("<br>端口名"+location.port +"<br>");
		document.write("<br>主机加端口名"+location.host +"<br>");
		document.write("<br>当前文档URL"+location.href +"<br>");
		document.write("<br>时间"+new Date().toLocaleString()+"<br>");

history()

		<input type="button" value="刷新" onclick="location.reload()"/>//location.reload()刷新页面
		<br>
		<a href="09window窗口对象.html">window窗口对象</a>
		<input type="button" value="返回" onclick="history.back()"/>//返回页面
		<input type="button" value="返回" onclick="history.go(-1)"/>//向后返回一次
		<input type="button" value="前进" onclick="history.forward()"/>//前进
		<input type="button" value="前进" onclick="history.go(1)"/><br>//前进
		<!-- 按钮当作超链接 -->
		<input type="button" value="window窗口对象" onclick="location.href='09window窗口对象.html'"/>//点击按钮实现跳转
	<a href="javascript:history.go(1)">前进3</a>//javascript:加上后,history.go(1)才不会被当作地址,而作为js执行

navigator

		document.write("<h3>navigator对象</h3>");
		document.write("<br>浏览器名称"+navigator.appName +"<br>");
		document.write("<br>浏览器版本"+navigator.appVersion +"<br>");
		document.write("<br>浏览器类型"+navigator.userAgent +"<br>");
		document.write("<br>操作系统"+navigator.platform +"<br>");
		document.write("<br>是否启用java"+navigator.javaEnabled()+"<br>");
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值