dom对象模型简介

 
 
1、掌握打开新窗口方法
//返回新窗口的 window 对象
V ar newWindow = window.open("url","新窗口名字 "," 新窗口特性 ");
 
//关闭窗口,如果是主窗口会有提示
window.close();
 
1、  掌握系统对话框
window.alert("字符串 ");// 消息框
window.confirm("选择是或否 ");// 选择框
window.prompt("提示信息 "," 默认值 ");// 输入框
 
2、  时间函数
var id=window.setTimeout("执行代码 ", 毫秒数 );
window.clearTimeout(id)
 
var id=window.setInterval("执行代码 ", 毫秒数 );
window.clearInterval(id);
3、  历史对象
window.history.back();后退
window.history.forward();前进
 
4、  document对象
document代表窗口的空白区域。
document是 window 的属性
 
DOM和 BOM 均定义了 doucment
 
document.title : 标题栏
document.URL : 当前页面的 URL ,即地址栏信息,可跳转页面
 
5、  location对象
跳转到新页面
location.href = "a.html"
location.replace( a.html );//没有历史信息
刷新页面 location.reload(boolean);
true : 从服务器刷新
false : 本地刷新
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值