立即学习:https://edu.csdn.net/course/play/4994/90066?utm_source=blogtoedu
一、什么是BOM:
BOM是浏览器对象模型,是浏览器提供给JS的对象模型
B:Browers
O:Object
M:Model
二、window对象下的属性和方法
var a = 10;
alert(window.a);
打开页面格式:
window.open(url地址,设置参数,是否替换原有页面);
window.open("a.html");
window.open("a.html","_blank");
window.open("a.html","_blank","width=300,height=300,left = 300, top = 200");
事件:
html中:<input type = "button" value = "点击" id = "btn">
js调用:btn.onclick = function(){
window.open("a.html");
}
注意:火狐浏览器只能关闭用脚本语言打开的页面,非脚本语言打开的页面不能用脚本语言关闭。