<html>
<head>
<meta charset="utf-8">
<title>window对象方法</title>
</head> <body>
<div style="text-align:center;text-">Window对象的方法</div>
<div id="divId"></div>
<input type="button" value="取消间歇定时器" onclick="clearInter()"/> <input type="button" value="打开新窗口" onclick="moveWin()"/> <input type="button" value="改变浏览器窗口大小" onclick="resizeWin()"/> <input type="button" value="打开新窗口" onclick="openWin()"/> <input type="button" value="新窗口自动关闭" onclick="testWin()"/> <input type="button" value="模态对话框自动关闭" onclick="testDialog()"/> <script language="javascript">
//01alert
//window.alert("alert!!!"); //02 确认对话框
//window.confirm("???"); //03 输入信息对话框
//window.prompt("提示信息","默认值"); //04 close() 关闭当前浏览器窗口
//window.close(); //05 导航到指定URL资源
//window.navigate("http://www.baidu.com");
//window.navigate('http://www.baidu.com'); //06 间歇定时器
var int=setInterval("inner()",2000);
var s="";
function inner(){
var div=document.getElementById("divId");
s+="Hello World!!!<br/>";
div.innerHTML=s;
} //07 定时计时器
//setTimeout('inner()',5000); //08 取消间歇定时器
//即使得当前间歇计时器停止执行,执行过的内容仍在
function clearInter(){
window.clearInterval(int);
} //09 取消定时计时器 参数为计时器变量
//window.clearTimeout(int); //10 移动浏览器窗口到指定的屏幕位置
//在IE浏览器中有效
function moveWin(){
myWin=window.open('http://www.baidu.com','_blank','width=200,height=100');
myWin.document.write("新窗口!!!");
myWin.moveTo(0,0);
myWin.focus();
} //11 改变浏览器窗口大小
function resizeWin(){
window.resizeTo(400,400);
} //12 打开新窗口
function openWin(){
window.open('http://www.baidu.com','_blank','top=10,left=0,toolbar=no,width=100,height=100');
} //13 模态对话框窗口 必须关闭模态对话框才能在原始网页窗口进行操作
//window.showModalDialog('http://www.baidu.com','zhangsan'); //14 非模态对话框窗口 不用关闭模态对话框也能在原始网页窗口进行操作
//window.showModelessDialog('http://www.baidu.com','zhangsan'); //测试打开一个小窗口 5秒后自动关闭
function testWin(){
myWin=window.open("./test02.html","_blank","width=100,height=100");
myWin.moveTo(0,0);
setTimeout("myWin.close()",5000);
} function testDialog(){
var myDialog=window.showModalDialog();
setTimeout('myDialog.close()',5000);
//
}
</script>
</body>
</html>
 <html>
<head>
<meta charset="utf-8">
<title>window对象方法</title>
</head> <body>
<div style="text-align:center;text-">Window对象的方法</div>
<div id="divId"></div>
<input type="button" value="取消间歇定时器" onclick="clearInter()"/> <input type="button" value="打开新窗口" onclick="moveWin()"/> <input type="button" value="改变浏览器窗口大小" onclick="resizeWin()"/> <input type="button" value="打开新窗口" onclick="openWin()"/> <input type="button" value="新窗口自动关闭" onclick="testWin()"/> <input type="button" value="模态对话框自动关闭" onclick="testDialog()"/> <script language="javascript">
//01alert
//window.alert("alert!!!"); //02 确认对话框
//window.confirm("???"); //03 输入信息对话框
//window.prompt("提示信息","默认值"); //04 close() 关闭当前浏览器窗口
//window.close(); //05 导航到指定URL资源
//window.navigate("http://www.baidu.com");
//window.navigate('http://www.baidu.com'); //06 间歇定时器
var int=setInterval("inner()",2000);
var s="";
function inner(){
var div=document.getElementById("divId");
s+="Hello World!!!<br/>";
div.innerHTML=s;
} //07 定时计时器
//setTimeout('inner()',5000); //08 取消间歇定时器
//即使得当前间歇计时器停止执行,执行过的内容仍在
function clearInter(){
window.clearInterval(int);
} //09 取消定时计时器 参数为计时器变量
//window.clearTimeout(int); //10 移动浏览器窗口到指定的屏幕位置
//在IE浏览器中有效
function moveWin(){
myWin=window.open('http://www.baidu.com','_blank','width=200,height=100');
myWin.document.write("新窗口!!!");
myWin.moveTo(0,0);
myWin.focus();
} //11 改变浏览器窗口大小
function resizeWin(){
window.resizeTo(400,400);
} //12 打开新窗口
function openWin(){
window.open('http://www.baidu.com','_blank','top=10,left=0,toolbar=no,width=100,height=100');
} //13 模态对话框窗口 必须关闭模态对话框才能在原始网页窗口进行操作
//window.showModalDialog('http://www.baidu.com','zhangsan'); //14 非模态对话框窗口 不用关闭模态对话框也能在原始网页窗口进行操作
//window.showModelessDialog('http://www.baidu.com','zhangsan'); //测试打开一个小窗口 5秒后自动关闭
function testWin(){
myWin=window.open("./test02.html","_blank","width=100,height=100");
myWin.moveTo(0,0);
setTimeout("myWin.close()",5000);
} function testDialog(){
var myDialog=window.showModalDialog();
setTimeout('myDialog.close()',5000);
//
}
</script>
</body>
</html>

DHTML_____window对象方法的更多相关文章

  1. js 继承 对象方法与原型方法

    js函数式编程确实比很多强语言使用灵活得多,今天抽了点时间玩下类与对象方法调用优先级别,顺便回顾下继承 暂时把原型引用写成继承 先看看简单的两个继承 var Parent = function(){} ...

  2. C++风格的回调对象方法. 采用template实现

    今天看了一篇文章,收藏一下代码.读一读很有激情 #include <iostream> #include <string> #include <vector> us ...

  3. 学习zepto.js(对象方法)[4]

    今天说说那一套获取元素集合的一些方法: ["children", "clone", "closest", "contents&qu ...

  4. Window对象方法

    Window对象方法 scrollBy() 按照指定的像素值来滚动内容. scrollTo() 把内容滚动到指定的坐标. setInterval() 按照指定的周期(以毫秒计)来调用函数或计算表达式. ...

  5. Document-对象属性和常用的对象方法

    Document-对象属性和常用的对象方法 对象属性 document.title                           //设置文档标题等价于HTML的title标签 document ...

  6. 学习zepto.js(对象方法)[1]

    zepto也是使用的链式操作,链式操作:函数返回调用函数的对象. 但并不是所有的对象方法都可以进行链式操作,举几个例子:.size(),.html()|.text()//不传参数的情况下; 若非特殊说 ...

  7. OC 类方法,对象方法,构造方法以及instancetype和id的异同

    OC 类方法,对象方法,构造方法以及instancetype和id的异同 类方法: 类方法是可以直接使用类的引用,不需要实例化就可以直接使用的方法.一般写一些工具方法. 类方法: 声明和实现的时候,以 ...

  8. 不用static,巧用对象.方法调用java中的函数

    先生成一个对象,用"对象.方法()"的方式调用. java中的main方法是静态的,用于程序的入口,在静态方法中无法调用非静态方法,只能调用静态方法.想调用静态方法的话就要先生成该 ...

  9. JavaScript Number 对象 Javascript Array对象 Location 对象方法 String对象方法

    JavaScript Number 对象 Number 对象属性 属性 描述 constructor 返回对创建此对象的 Number 函数的引用. MAX_VALUE 可表示的最大的数. MIN_V ...

随机推荐

  1. redis持久化机制【十三】

    一.Redis提供了哪些持久化机制: redis的高性能是因为其所有数据都存在了内存中 ,为了使redis在重启之后数据仍然不丢失,需要将数据同步到硬盘中,这一过程就是持久化. redis支持两种方式 ...

  2. java中文乱码问题的处理方式

    URL访问java时. 注意: URL: 编码二次 URLEncoder.encode(URLEncoder.encode(searchKey, "utf-8"),"ut ...

  3. springboot技术

      一 我们为什么要用SpringBoot? 1. SpringBoot核心功能 SpringBoot的核心最足要的功能是自动配置,简单说下springBoot,springboot可以替代额xml配 ...

  4. poj 2318 TOYS &amp; poj 2398 Toy Storage (叉积)

    链接:poj 2318 题意:有一个矩形盒子,盒子里有一些木块线段.而且这些线段坐标是依照顺序给出的. 有n条线段,把盒子分层了n+1个区域,然后有m个玩具.这m个玩具的坐标是已知的,问最后每一个区域 ...

  5. 安卓数据传递之---putextra与putextras

    一.public Intent putExtra (String name, double[] value) 设置方法 intent.putExtra("aaa", "b ...

  6. A星算法(Java实现)

    一.适用场景 在一张地图中.绘制从起点移动到终点的最优路径,地图中会有障碍物.必须绕开障碍物. 二.算法思路 1. 回溯法得到路径 (假设有路径)採用"结点与结点的父节点"的关系从 ...

  7. PromiseKit入门

    原文:Getting Started with PromiseKit 作者:Michael Katz 译者:kmyhy 异步编程真的让人头疼.不管你怎样小心,总是easy出现臃肿的托付.混乱的完毕句柄 ...

  8. Python爬虫开发【第1篇】【HTTP与HTTPS请求与响应】

    一.HTTP.HTTPS介绍 HTTP协议(超文本传输协议):一种发布.接收HTML页面的方法 HTTPS协议:简单讲是HTTP安全版,在HTTP下加入SSL层 SSL(安全套接层),用于WEB的安全 ...

  9. YII2 的授权(Authorization)

    说明:翻译本不是我应该做的,由于我的英语水平实在太差.但由于对YII的兴趣.所以也做一点.同一时候也能显示出我的胆量还是有的...希望不误导您. 由于这里MD语法的内容显示不全.您能够去这里看看. A ...

  10. 将代码设置的剪切板内容通过输入法软件粘贴入app搜索框

    #进入app搜索框位置--双击#等待输入法软件弹出#将代码设置的剪切板内容通过输入法软件粘贴入app搜索框#搜索 import win32apiimport timeimport win32clipb ...