- 浏览: 415764 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
jxausea:
java.io.IOException: Keystore w ...
一个opoenfire与smack的例子 -
517913840:
请问 为什么我用roster.getPresence取用户的在 ...
一个opoenfire与smack的例子 -
cymmint:
请了,大哥
轻松利用JQuery实现ajax跨域访问 -
lishujuncat:
多谢,学下了
一个opoenfire与smack的例子 -
InSoNia:
不错
最简单的ajax例子
window.open() 传参问题:
父页面中:
url页面拿父页面的xx元素赋值
window.open() 传值问题(参考:http://www.cnblogs.com/gavindou/archive/2008/04/09/1143858.html):
a.html(父)
注意:window.open("b.html","","modal=yes,width=500,height=500,resizable=no,scrollbars=no"); 中的第3个参数一定要有 modal=yes
b.html(子)
父页面中:
window.open('url', '', 'resizable=1, menuBar=0, toolBar=0, scrollbars=yes, Status=yes, resizable=1');
url页面拿父页面的xx元素赋值
opener.document.getElementById("xx").value="newValue";
if(window.opener){//判断是否有父窗口,即打开本页面的窗口 window.opener.location.reload();//刷新父窗口 window.opener.close(); //关闭父窗口 }
window.open() 传值问题(参考:http://www.cnblogs.com/gavindou/archive/2008/04/09/1143858.html):
a.html(父)
注意:window.open("b.html","","modal=yes,width=500,height=500,resizable=no,scrollbars=no"); 中的第3个参数一定要有 modal=yes
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>a.html文档</title> <script type="text/javascript"> function openstr() { window.open("b.html","","modal=yes,width=500,height=500,resizable=no,scrollbars=no"); } </script> </head> <body> <form id="form1" name="form1" method="post" action=""> <label> <select name="txtselect" id="txtselect"> </select> </label> <label> <input type="button" name="Submit" value="打开子窗口" onclick="openstr()" /> </label> </form> </body> </html>
b.html(子)
<html > <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>b.html文档</title> <script type="text/javascript"> function ClickOk() { var t=document.Edit; var color=t.color.value; if(color==null||color=="填写颜色") return(false); var oOption = window.opener.document.createElement('OPTION'); oOption.text=document.getElementById("color").value; oOption.value=document.getElementById("color").value; //检查浏览器类型 var bname = navigator.appName; if (bname.search(/netscape/i) == 0) { window.opener.document.getElementById("txtselect").appendChild(oOption); } else if (bname.search(/microsoft/i) == 0) { window.opener.document.all.txtselect.add(oOption); } else { } window.close(); } </script> </head> <body> <table border="0" cellpadding="0" cellspacing="2" align="center" width="300"> <form name="Edit" id="Edit"> <tr> <td width="30" align="right" height="30">color:</td> <td height="30"><input type="text" name="color" id="color" value="填写颜色" /></td> <td width="56" align="center" height="30"><input " type="button" name="bntOk" value="确认" onclick="ClickOk();" /> </td> </tr> </form> </table> </body> </html>
var url = '/xxx/xx.jsp?yearNum='+yearNum; if (typeof window.ActiveXObject != 'undefined') { // 支持IE浏览器 var weekNum=document.getElementById("weekNum").value; var arguments = new Array(); arguments[0] = weekNum; var returnValue = window.showModalDialog(url,arguments,'dialogHeight:500px;dialogWidth:380px;dialogTop:300px; dialogLeft:500px;center:yes;scroll:yes;status:no;resizable:no;edge:raised;help:no;unadorned:yes'); if(returnValue!=null && returnValue[0]){ document.getElementById("weekNum").value=returnValue[1]; document.getElementById("beginDate").value=returnValue[2]; document.getElementById("endDate").value=returnValue[3]; } } else if((typeof document.implementation != 'undefined') &&(typeof document.implementation.createDocument!='undefined')) { // 支持Mozilla浏览器 window.open(url,'weekNum','modal=yes,menubar=0,status=0,toolbar=0,scrollbars=1,resizable=1,width=400px,height=500px,top=300,left=500'); }
发表评论
-
javascript url 传递参数中文乱码问题解决方案
2010-03-04 16:49 6019本文来自http://hi.baidu.com/%B4%FA% ... -
javascript创建节点div时,设置float属性不能生效
2009-09-01 10:41 1536好像浮动属性不能写成diva.style.float来改 . ... -
关于javascript的Array对象
2009-07-09 08:23 1336//Javascript中Array的默认方法里没有提供ind ... -
javascript离开当前页面就出发事件
2009-07-06 14:27 3255<!DOCTYPE HTML PUBLIC " ... -
用javascript向多选框添加监听事件!
2009-06-09 17:41 2974<html> <body> ... -
(网页一开始就加载)用JS弹出网页对话框后,后面那一层变灰,变成不可操做。
2009-02-27 15:33 0(可参考发布的一篇-用JS弹出网页对话框后,后面那一层变灰,变 ... -
替代全角和半角括号的方法示例
2009-02-26 14:36 3757<html> <head> & ... -
javascript中的各种输入限制
2009-02-26 14:19 1469转自http://www.blogjava.net/dream ... -
有关层定位、显示、隐藏的例子
2009-02-11 17:12 2265要移动层(把层移动到某个位置)就必须先将层设置绝对定位 sty ... -
想把某些内容固定在某些地方总是显示当前页面上
2008-12-16 16:23 1365作用:当在一个内容很长的页面中,想把某些内容固定在某些地方总是 ... -
css细线表格
2008-10-08 17:12 1413<style type="text/css ... -
jquery手记
2008-09-12 14:03 2607JQuery拿取对象的方式 $(‘#id’) :通过元素的id ... -
css细线表格
2008-09-03 10:21 2339<style type="text/css&q ... -
用JS弹出网页对话框后,后面那一层变灰,变成不可操做。
2008-08-21 17:21 6050<html> <head> & ... -
javascript+CSS下拉菜单演示
2008-08-21 15:15 3241<!DOCTYPE html PUBddC " ... -
javascript 显示剩余的时间
2008-08-15 09:05 2248function formatTime(reallyTime) ... -
javascript屏蔽按健
2008-08-05 09:00 1106document.oncontextmenu=function ... -
javascript时间差
2008-07-31 14:38 1889var d1=new Date(2008,7,10 ... -
firefox并不支持selectSingleNode和selectNodes的解决方法
2008-06-30 09:27 5434function test(){ var perid = ... -
IE和firefox中的一些javascript总结
2008-06-17 10:15 2332注意的一些问题: (一)尽量使用javascript/DOM ...
相关推荐
Web开发中的window.open父子窗口传值问题 部署在tomcat中进行
对window.open进行封装, 使其更好用, 且更兼容, 很多人说window.open不兼容,其实不是, 因为不能直接执行, 必须通过用户手动触发才行;看代码: 代码如下 var openWindow = function(url, options) { var str = ""; ...
window.showModalDialog以及window.open用法简介 父子窗口传值
扩展window.open方法,使得window.open时针对相同的URL地址非打开新窗口,而是仅仅激活已存在窗口,另外,此激活不会刷新页面,不会丢失页面上已存在的数据
弹出窗口,并且弹出窗口要求最大化处理,window.open打开的窗口获取到焦点
Window.open ('page.html') 用于控制弹出新的窗口page.html,如果page.html不与主窗口在同一路径下,前面应写明路径,绝对路径(http://)和相对路径(../)均可。用单引号和双引号都可以,只是不要混用。 这一段代码...
主要讲解了如何利用window.open打开新窗口,和打开新窗口时的一些参数的设置,很实用的。
windows.open这个是JavaScript函数,但是在应用起来的时候总会遇到比较多的麻烦,因为参数非常多,用法也非常的多
javascript showModalDialog传值与FireFox的window.open 父子窗口传值示例代码。
window.showModalDialog以及window.open用法简介
window.open打开新窗口,不被拦截的方法
NULL 博文链接:https://shawnfree.iteye.com/blog/598885
关于window.open的一些特性,一些你经常不注意的,值的一看啊
一、window.open()支持环境: 二、基本语法: 三、示例: 四、各项参数
当在网页中用javascript winow.open 打开一个新窗口后,是否能在你窗口中调用并执行新窗口中的代码或调取其中的元素? 答案是肯定的。 这段示例代码不但能在父窗口页面test.html中执行被打开的新窗口页面test-open...
javascript 打开页面window.location和window.open的区别.docx
window.open()参数大全,window.open()参数大全,window.open()参数大全。
window.open使用方法以及参数说明一、window.open()支持环境: JavaScript1.0+/JScript1.0+/Nav2+/IE3+/Opera3+ 二、基本语法: window.open(pageURL,name,parameters) 其中: pageURL 为子窗口路径 name 为子窗口...
[removed] var timer var winOpen function IfWindowClosed() { if (winOpen.closed == true) { document.fm_Info.txtValue.value=”child closed” window.clearInterval(timer) } } [removed] <input type=b