日期:2014-05-16  浏览次数:20428 次

怎样用JAVASCRIPT非模态对话框里对父框架进行控制?
框架如下:
<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.01   Frameset//EN ">
<html>
<head>
<TITLE> OA.NET </TITLE>
<META   HTTP-EQUIV= "Content-Type "   CONTENT= "text/html;   charset=gb2312 ">
<meta   name= "GENERATOR "   content= "Microsoft   Visual   Studio   .NET   7.1 ">
<meta   content= "http://schemas.microsoft.com/intellisense/ie5 "   name= "vs_targetSchema ">
</head>
<frameset   rows= "75,73%,37 "   border= "0 "   frameSpacing= "0 "   frameBorder= "0 ">
<frame   name= "header "   src= "Frame_Top.aspx "   scrolling= "no "   noresize   frameborder= "0 ">
<frameset   cols= "180,* "   frameborder= "0 "   border= "0 "   framespacing= "0 ">
<frame   name= "contents "   src= "Frame_Left.aspx "   frameborder= "0 "   scrolling= "auto "   marginheight= "0 "
framespacing= "0 ">
<frame   name= "main "   src= " "   frameborder= "NO "   SCROLLING= "auto ">
</frameset>
<frame   name= "footer "   src= "Frame_Buttom.aspx "   scrolling= "no "   noresize   framespacing= "0 "   frameborder= "0 ">
<noframes>
<pre   id= "p2 ">
================================================================
关于完成此“页眉-页脚-内容”框架集的说明
1.   为“header”框架添加   src= " "   页的   URL。
2.   为“contents”框架添加   src= " "   页的   URL。
3.   为“main”框架添加   src= " "   页的   URL。
4.   为“footer”框架添加   src= " "   页的   URL。
5.   将   BASE   target= "contents "   元素添加到“header”页的  
HEAD,以将“contents”设置为默认框架,“header”页的链接将
在该框架中显示其他页。
6.   将   BASE   target= "contents "   元素添加到“contents”页的  
HEAD,以将“main”设置为默认框架,“contents”页的链接将
在该框架中显示其他页。
7.   将   BASE   target= "contents "   元素添加到“footer”页的  
HEAD,以将“contents”设置为默认框架,“footer”页的链接将
在该框架中显示其他页。
================================================================
</pre>
<p   id= "p1 ">
此   HTML   框架集显示多个   Web   页。若要查看此框架集,请使用支持   HTML   4.0   及更高版本的   Web   浏览器。
</p>
</noframes>
</frameset>
</html>


怎样用JAVASCRIPT非模态对话框里对父框架进行控制?比如我要在框架右窗口里刷新页面:
window.parent.parent.frames( "main ").location.href= "../Mailbox/HarvestMail/Detail.aspx?ID= "+currID+ "&ts= "+Math.random();

这样写好象不行?请教各位高手




------解决方案--------------------
那样肯定不行的。首先你要找到打开你的页面,才可以进行你上面的代码。给LZ一个思路吧:

在打开窗口的时候,把Window作为参数传到模式对话框里,然后在模式对话框中,对这个
Window进行控制就可以了

IE中非模式对话框(showModelessDialog)应用
非模式对话框是IE的一种窗口形式,打开非模式对话框后,在其被关闭之前,主调窗口不会继续解析其后的htm代码,同时主调窗口也不会被选中。

主调窗口与非模式窗口的信息传递
1.函数调用传递方式
vReturnValue = window.showModelessDialog ( sURL [, vArguments] [, sFeatures] )