会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Sun_china
交流更多,收获更多?
博客园
首页
新随笔
联系
订阅
管理
公告
模式窗口刷新父窗口
模式窗口中点击按钮让父窗口跳转到新的页面,不可用 opener.document.location 方式来设置,只能在父窗口把当前window对象传递到模式窗口,模式窗口使用 dialogArguments 来获得父窗口对象。
父窗口(需要把当前页面window对象传递到模式窗口页面)
<
a
href
="javascript:Openersub('qy.htm');"
>
test
</
a
>
<
script
>
function
Openersub(strUrl)
{
var
vTmd
=
Math.random();
var
vReturn
=
'';
var
strFeature
=
'dialogWidth:530px;dialogHeight:470px;status:
0
;scroll:
1
:
0
;help:
0
;';
if
(strUrl.indexOf('
?
')
>-
1
)
{
vReturn
=
window.showModalDialog(strUrl
+
'
&
tmd
=
'
+
vTmd,window,strFeature);
}
else
{
vReturn
=
window.showModalDialog(strUrl
+
'
?
tmd
=
'
+
vTmd,window,strFeature);
}
}
</
script
>
弹出的模式窗口
<
span
>
确认跳转到新的页面?
<
span
>
<
p
/>
<
input
type
="button"
value
="确定"
onclick
="dialogArguments.location='http://www.baidu.com';window.close()"
>
<
input
type
="button"
value
="关闭"
onclick
="window.close()"
>
posted on
2007-04-18 17:26
Sun_china
阅读(
664
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
Powered by:
博客园
Copyright © 2024 Sun_china
Powered by .NET 8.0 on Kubernetes