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