标签:www pre title sed 定时 head 页面跳转 hid lap
<!DOCTYPE html>
< html >
< head lang = “ en ” >
< meta charset = “ UTF-8 ” >
< title >窗口对象</ title >
<! -
BOM :(浏览器对象模型浏览器对象模型)
博览器页面的前进后退刷新页面跳转都是Bom!
对整个浏览器窗口进行交互的对象模型!
包含的内容(对象):
1.window对象
01.history属性
02.location属性
2.document对象
窗口对象
常用的属性:
01.history属性
02.location属性
常用的方法:
alert():只有一个对话框和一个确认按钮
prompt():提示用户输入的对话框
确认():有一个确认按钮和取消按钮的对话框
close():关闭浏览器窗口
打开():打开一个新的浏览器窗口
定时函数:
01.setTimeout():在指定毫秒数之后,执行某个方法!只执行一次
02.setInterval():每间隔指定的毫秒数,都会执行一次!
window.open( “弹出的窗口的URL”, “窗口的名称”, “窗口的特性”)
- >
</ head >
< body >
< script type = “ text / javascript ” >
var flag = confirm(“确定关闭本窗口吗?”);
if(flag){
窗口。close(); //浏览器窗口关闭
} else {
// window.open(“http://www.baidu.com”,“百度首页”);
窗口。打开(“ http://www.baidu.com ”,“百度首页”,“ height = 400,width = 400 ”);
}
< / script >
</ body >
</ html >
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>history对象</title>
<!--
history对象常用的三个方法:
01.back() :后退
02.forward():前进
03.go() :跳转至指定的url
-->
</head>
<body>
<a href="02history对象.html">当前页面</a>
<a href="03history对象2.html">下一个页面</a>
<a href="javascript:history.forward()">history.forward()下一个页面</a>
<a href="javascript:history.go(2)">history.go(2)下一个页面</a>
<script type="text/javascript">
</script>
</body>
</html>
标签:www pre title sed 定时 head 页面跳转 hid lap
原文地址:http://www.cnblogs.com/zwy0709/p/7779646.html