showModalDialog的简单问题!!! 我在A页面上有一个按钮和一个文本框,点击按钮后用showModalDialog打开一个弹出页,弹出页里有很多checkbox,我的目的是在弹出页里把勾选的项的文本传回到A页面里的文本框里(在弹出页里选好项后点击一个按钮传)... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 弹出的页面: window.returnValue = xxx; 接收页面: document.all.txt.value = showModalDialog('','',''); 楼上的正解.也可以通过dialogArguments传递一个对象过去,然后在新窗口设置该对象的属性当作返回值.醉翁之意不在答问题,在于发广告也------------------------------------------------我们要新招一个JavaScript的开发人员哦.有人有兴趣来吗??http://www.cnblogs.com/Lostinet/archive/2008/01/31/1059527.html index.html<script>function hehe(){ var result = window.showModalDialog("index2.html","","dialogLeft=100;dialogTop=150;dialogWidth=200px;dialogHeight=100px;status=no"); var haha = document.getElementById("haha"); haha.value=""; for(var i=0; i<result.length; i++) { haha.value += result[i]; }}</script><input type="text" id="haha" /><input type="button" value="Test" onclick="hehe();" />index2.html<script>function hehe(){ var index=0; var array = new Array(); var checks = document.getElementsByName("hehe"); for(var i=0; i<checks.length; i++) { if(checks[i].checked==true) { array[index++]=checks[i].value; } } window.returnValue = array; window.close();}</script><input type="checkbox" name="hehe" value="A" />A<input type="checkbox" name="hehe" value="B" />B<input type="checkbox" name="hehe" value="C" />C<input type="checkbox" name="hehe" value="D" />D<input type="checkbox" name="hehe" value="E" />E<br><input type="button" value="Test" onclick="hehe()" /> index.html最后一行在添加一行window.onunload=hehe; 可以把A页面的整个window对象传过去。这样想调用什么就OK了 把Window都穿过去有没有效率问题啊 求助 一个JS 的例子 在线等。。。。。 请指教错在哪呢?IE总提示语法错误 100分问:关于替换的问题(解决立即结贴) firefox中window.event的疑问 怎么对object.id进行字符串操作? js中如何把selected传递到option上 高分求助,在线急等,立即结贴 对字符串中各字符进行移位、异或运算? 在location.href中写入参数 如何用JAVASCRIPT做下面的功能呢? 高手帮我看一下这段Javascript为何不弹窗口 时间判断
window.returnValue = xxx;
接收页面:
document.all.txt.value = showModalDialog('','','');
然后在新窗口设置该对象的属性当作返回值.
醉翁之意不在答问题,在于发广告也------------------------------------------------我们要新招一个JavaScript的开发人员哦.有人有兴趣来吗??
http://www.cnblogs.com/Lostinet/archive/2008/01/31/1059527.html
<script>
function hehe()
{
var result = window.showModalDialog("index2.html","","dialogLeft=100;dialogTop=150;dialogWidth=200px;dialogHeight=100px;status=no");
var haha = document.getElementById("haha");
haha.value="";
for(var i=0; i<result.length; i++)
{
haha.value += result[i];
}
}
</script>
<input type="text" id="haha" />
<input type="button" value="Test" onclick="hehe();" />index2.html
<script>
function hehe()
{
var index=0;
var array = new Array();
var checks = document.getElementsByName("hehe");
for(var i=0; i<checks.length; i++)
{
if(checks[i].checked==true)
{
array[index++]=checks[i].value;
}
}
window.returnValue = array;
window.close();
}
</script>
<input type="checkbox" name="hehe" value="A" />A
<input type="checkbox" name="hehe" value="B" />B
<input type="checkbox" name="hehe" value="C" />C
<input type="checkbox" name="hehe" value="D" />D
<input type="checkbox" name="hehe" value="E" />E<br>
<input type="button" value="Test" onclick="hehe()" />
最后一行在添加一行
window.onunload=hehe;