function check()
{
new_win=window.open("print.html","test")
}
function pd()
{
if(!new_win)//窗口没有打开
{
check()
}
else
{
window.location.href="2.htm" //转到其他页面
}
}
{
new_win=window.open("print.html","test")
}
function pd()
{
if(!new_win)//窗口没有打开
{
check()
}
else
{
window.location.href="2.htm" //转到其他页面
}
}
解决方案 »
- easyUI中treegrid子列表数据加载的方式问题
- 怎么自定义JqueryUIdialog的样式,去掉标题栏和背景
- 请问一下这样的效果可以做吗?
- 页面 弹出div 怎么写
- iframe内容改变时触发一个函数
- js 移动DIV 并且可以交换DIV的位置
- div对象和input对象问题:为什么alert(a1.width)能执行;而alert(a2.value)不能执行!
- 有10个input文本框。要判断10个里面不为空的都不相等,有什么好办法 。谢谢了!
- 如何取得中文输入的真实长度?
- web开发在后台将数据转化为字符串,将字符串传递给前台,在前台进行解析
- 有关网页最大化和最小化的奇怪问题
- 请教高手一个困扰很久的问题
看来我真的没有说清楚
function check()
{
new_win=window.open("print.html","test")
}
function pd()
{
if(!new_win)//窗口没有打开
{
check()
}
else
{
window.location.href="2.htm" //转到其他页面
}
}思路是这样的window.location.href="2.htm"不是我要表达的意思,window.location.href="2.htm"应该还是print.html,但是写成这样的话,页面就会刷新
我不想让页面刷新
谢谢
然後在打開窗口之前判斷一下這個返回值.
例如:var wnd;function openWindow()
{
if (!wnd) wnd = window.open("print.html","test");
wnd.focus();
}這樣窗口就不會重複打開了.
要定义成全局的吗?