2015.7.15

本文深入探讨了JavaScript中Window对象和document对象的操作,包括窗口管理、文档属性查询、系统对话框使用、状态栏设置、时间间隔控制、历史记录导航等核心功能。同时详细介绍了如何通过这些API实现网页的动态交互与用户体验提升。

1. Window 对象

1)窗口操作

 moveBy(dx, dy); moveTo(x, y); resizeBy(dw, dh); resizeTo(w, h)

2)浏览器离左边屏幕和上边屏幕的距

1. Window 对象

1)窗口操作

 moveBy(dx, dy); moveTo(x, y); resizeBy(dw, dh); resizeTo(w, h)

2)浏览器离左边屏幕和上边屏幕的距

alert(window.screenLeft);

alert(window.screenTop);

alert(document.body.offsetWidth);

alert(document.body.offsetHeight)

alert(window.screenX); 

alert(window.screenY); 

alert(window.innerWidth);

alert(window.innerHeight);

 

3)打开窗口

Window.open()

关闭窗口

Window.close()

4)系统对话框

alert("Hello world");  comfirm("Are you sure?");  prompt("");

5)状态栏

window.defaultStatus = "测试数据";

window.status = "test";

6)时间间隔和暂停

setTimeout("alert('hello world')",1000);

clearTimeout();

7)历史

history.back();

history.forward();

2. document对象

1) 通用属性

lastModified  referrer  title  URL

2) 集合

anchors applets embeds forms images links

3. location 对象

location.href   location.assign  location.reload

 

3)打开窗口

Window.open()

关闭窗口

Window.close()

4)系统对话框

alert("Hello world");  comfirm("Are you sure?");  prompt("");

5)状态栏

window.defaultStatus = "测试数据";

window.status = "test";

6)时间间隔和暂停

setTimeout("alert('hello world')",1000);

clearTimeout();

7)历史

history.back();

history.forward();

2. document对象

1) 通用属性

lastModified  referrer  title  URL

2) 集合

anchors applets embeds forms images links

3. location 对象

location.href   location.assign  location.reload

 

转载于:https://www.cnblogs.com/wangchang2015/p/4650899.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值