JavaWeb - JavaScript中Window对象
来源:互联网 发布:数据库应用领域 编辑:程序博客网 时间:2024/05/21 06:19
打开网页
<html><head><title></title><script language="javascript">function fun(thisurl){window.open(thisurl) ;}</script></head><body onLoad="fun('index.html')"></body></html>
控制窗口大小
<html><head><title></title><script language="javascript">function fun(thisurl){window.open(thisurl, "页面标题", "width=500, height=150, scrollbars=yes, resizeable=no") ;}</script></head><body onLoad="fun('index.html')"></body></html>
Demo
<html><head><title></title><script language="javascript">function fun(thisurl){window.open(thisurl, "页面标题", "width=500, height=150, scrollbars=yes, resizeable=no") ;}</script></head><body><form action="" method="post" name="myform">网址:<select name="url" onChange="fun(this.value)"><option value="index.html">index</option><option value="3.html">3</option> </select></form></body></html>
确认提示按钮
<html><head><title></title><script language="javascript">function fun(){if(window.confirm("确认删除?")){alert("您选择的是'是'!") ;} else {alert("您选择的是'否'!") ;}}</script></head><body><a href="#" onclick="fun()">删除邮件</a></body></html>
重定向
<html><head><title></title><script language="javascript">function fun(thisurl){window.location = thisurl ;// 重定向}</script></head><body>网站:<select name="url" onChange="fun(this.value)"><option value="#">== 请选择要浏览的站点 ==</option><option value="http://www.baidu.com">百度</option><option value="http://blog.csdn.net/imwangjiping">wjp博客</option> </select></body></html>
子窗口调用父窗口(子窗口操作父窗口中的一些对象)
父窗口<html><head><title></title><script language="javascript">function fun(thisurl){window.open(thisurl, "页面标题", "width=500, height=150, scrollbars=yes, resizeable=no") ;}</script></head><body><input type="button" value="打开" onClick="fun('3.html')" ></body></html>
子窗口<html><head><title></title><script language="javascript">function closeWin(){window.close() ;// 关闭窗口}window.opener.location.reload() ;// 刷新页面</script></head><body><h3><a href="#" onclick="closeWin()" >关闭</a></h3></body></html>
子窗口调用父窗口(子窗口操作父窗口中的一些对象)Demo
父窗口<html><head><title></title><script language="javascript">function fun(thisurl){window.open(thisurl, "页面标题", "width=500, height=150, scrollbars=yes, resizeable=no") ;}</script></head><body><form name="parentform"><input type="button" value="选择信息" onclick="fun('3.html')" ><br>选择的结果:<input type="text" name="result"></form></body></html>
子窗口<html><head><title></title><script language="javascript">function returnValue(){var city = document.myform.city.value ;// 取出当前选择好的信息var doc = window.opener.document ;// 取得父窗口文档doc.parentform.result.value = city ;// 设置新内容window.close() ;}</script></head><body><form name="myform">选择:<select name="city"><option value="北京">北京</option><option value="上海">上海</option><option value="深圳">深圳</option><option value="广州">广州</option><option value="天津">天津</option></select><input type="button" value="返回" onclick="returnValue()"></form></body></html>
0 0
- JavaWeb - JavaScript中Window对象
- Javaweb中JavaScript的window对象
- javascript中window对象
- Javascript中window对象简介
- javascript 中 window 的对象
- Javaweb中JavaScript的String对象
- Javaweb中JavaScript的Number对象
- Javaweb中JavaScript的Math数学对象
- Javaweb中JavaScript的Array数组对象
- JavaScript中window对象的描述
- JavaScript中window对象的描述
- JavaScript中window对象的描述
- 详尽解析JavaScript中window.event对象
- javascript中window对象的介绍
- javascript中window对象及属性
- 说说 JavaScript 中 BOM 的 window 对象
- JavaScript中window.location对象介绍
- Javaweb中JavaScript地址栏对象和屏幕对象
- Python之实现简单的注册登录系统
- R语言 一元线性回归
- windows 下配置 rsync
- [硬件结构]为什么branch prediction和cache在硬件体系结构中这么重要?
- JDK1.5或以上版本泛型报错
- JavaWeb - JavaScript中Window对象
- Andorid 清除项目中不用的资源
- web链接跳转安卓app的问题
- 数据量大MSYQL并发
- R树空间索引
- ARRAYLIST VECTOR LINKEDLIST 区别与用法(2014-10-14)
- DataInputStream和DataOutputStream类
- 将整数转换成数组的相关题目
- Session中StateServer的用法