function testOpen(){
window.open('ad.html','_blank','width=400px, height=400px');
// window.open('http://www.baidu.com','_blank','width=400px, height=400px');
}
function testInterval(){
setInterval("testOpen()",2000);
}
</script>
<input type="button" value="open()" onclick="testOpen()"/>
<input type="button" value="setInteval()" onclick="testInterval()"/>
窗口: window 对象
open(): 在一个窗口中打开页面
参数1: 打开的页面
参数2:打开的方式。
_self: 本窗口 _blank: 新窗口(默认)
参数3: 设置窗口参数。比如窗口大小,
是否显示任务栏 toolbar=0不显示地址栏(兼容性不好)
setInterval(): 设置定时器(执行n次)
setInterval(函数名,毫秒)
setInterval("函数名()",毫秒)
参数1:指定的任务(函数)
参数2:毫秒数 地址栏: location 对象 历史记录栏: history 对象 屏幕:screen 对象
clearinterval清除定时
clearinterval(函数名,毫秒)
clearinterval(“函数名()”,毫秒)
参数1:指定的任务(函数)
参数2;毫秒数
lcerinterval():清除定时器
seTimeout():设置定时器。(只执行一次
clearTimeout()清除定时器
location对象:
href属性:代表是地址栏的URL,可以获取是设置URL
reload()方法:刷新当前页面
function testOpen(){
location.href ='ad
'
}