您的位置:首页 > Web前端 > JavaScript

JavaScript 编程

2015-08-14 21:02 453 查看

第四章 浏览器对象模型BOM

BOM:对浏览器进行访问和操作

基本BOM体系结构

window:

1、document(1、anchors 2、forms 3、images 4、links 5、location)

2、frames

3、history

4、location

5、navigator

6、screen

系统对话框:

confirm(“Are you sure?”)//返回Boolean,确定为true,取消为flash

prompt(“你的名字是什么?”, “Mike”)//"你的名字是什么?"为输入框提示,“Mike”为默认文本

时间间隔和暂停

所谓暂停是指在指定的毫秒数后执行指定的代码

时间间隔是指反复执行指定的代码,每次执行之间等待指定的毫秒数

setTimeout(“alert(‘Hello world!’)”, 1000);

历史

history.go(-1);

history.back();

//返回一页

history.go(1);

history.forward();

//前进一页

location对象

href---当前载入的页面的完整URL

window.location和document.location相互等价,可以交换使用。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: