FireFox里如何实现象IE模式对话框那样,当得到返回值时才往下执行? 难道要循环检查name的值,当不为空时才执行? shi di 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这样如何保证在没有取得返回值时,FF不往下执行???检测后,return false 不行嘛~~ 我以前就是循环检测的javascript:var x=window.open(location.href);var p=setInterval(function(){if (x.document.readyState=='complete'){alert('子窗口加载完毕');clearInterval(p);}},1000);void(0); 3楼说的只是检测子窗口是否已经加载完成,但是我希望当用户在子窗口向父窗口设了值以后,父窗口的代码才继续执行。我在父窗口中这样写:while( hasvalue == true){ setTimeout("checkReturnValue()", 1000);}...function checkReturnValue(){ if (!document.getElementById("name").value) { hasvalue = true }}hasvalue是个全局变量,初值为false。这样写为什么总是死循环?是不是if (!document.getElementById("name").value)写得不对?刚接触javascript,不太熟悉,望各位大虾指点。 刚才写错了,应该是while (hasvalue == false) 解决了。var time2;function openWindow(){ var left = 0 var top = 0 if (screen.width > 1024 ) { left = (screen.width - 1024)/2 } if (screen.height > 960 ) { top = (screen.height - 960)/2 } newWindow = window.open("getName.htm","_blank","modal=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=400, height=300, left=" + left +", top=" + top +"") newWindow.focus() time2 = setInterval("checkReturnValue()", 1000)}function checkReturnValue(){ var va = document.getElementById("name"); if (va.value != "") { alert(va.value); clearInterval(time2); }}...<body><input type="button" onClick="openWindow()" value="弹出"><input type="hidden" name="name" id="name" value=""></body> 关于窗口获取焦点问题,ie下有时候有用有时候没用 window.showdialog传值问题,怎么获取不到呢 <问题>取消超链接问题 div 的onclick事件动态添加没效果? 急求:如何将html 转化成 html dom树? 脚本错误:"return 语句不能在函数之外" 请大家帮忙看一下,为什么都执行完毕了,还报错啊? 怎么把文本框中的内容保存成html文件? 我想做一个按钮,单击这个按钮,在新的窗口打开一个页面,应该怎么写呢?:( 请教各位大侠,如何动态创建一个透明的层 Javascript高手在哪呢!!! 在指定的范围内实现鼠标跟随并显示鼠标坐标 (有代码)
javascript:var x=window.open(location.href);var p=setInterval(function(){if (x.document.readyState=='complete'){alert('子窗口加载完毕');clearInterval(p);}},1000);void(0);
while( hasvalue == true)
{
setTimeout("checkReturnValue()", 1000);
}
...function checkReturnValue()
{
if (!document.getElementById("name").value)
{
hasvalue = true
}
}hasvalue是个全局变量,初值为false。这样写为什么总是死循环?是不是
if (!document.getElementById("name").value)
写得不对?刚接触javascript,不太熟悉,望各位大虾指点。
var time2;
function openWindow()
{
var left = 0
var top = 0
if (screen.width > 1024 ) {
left = (screen.width - 1024)/2
}
if (screen.height > 960 ) {
top = (screen.height - 960)/2
} newWindow = window.open("getName.htm","_blank","modal=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=400, height=300, left=" + left +", top=" + top +"") newWindow.focus() time2 = setInterval("checkReturnValue()", 1000)
}function checkReturnValue()
{
var va = document.getElementById("name");
if (va.value != "")
{
alert(va.value);
clearInterval(time2);
}
}
...
<body>
<input type="button" onClick="openWindow()" value="弹出">
<input type="hidden" name="name" id="name" value="">
</body>