我在index.htm页面定义了如下函数:
function popWindow(urlstr) // 弹出定制的窗口
{
if(window.name == "VideoView")
{
window.location = urlstr;
}
else
{
var WinWidth = 755;
var WinHeight = 550;
var top = (window.screen.height-WinHeight)/2;
var left = (window.screen.width-WinWidth)/2; window.open(urlstr,"VideoView","toolbar=no,width="+WinWidth+",height="+WinHeight+",top="+top+",left="+left+"");
window.opener = null;
self.close();
}
}
然后在打开的新窗口中,有如下操作:
<script for="Webocx" event="reboot()" language="javascript">
window.parent.window.location="index.htm";
</script>结果回到index.htm页面后无法再打开新窗口了?为什么?
function popWindow(urlstr) // 弹出定制的窗口
{
if(window.name == "VideoView")
{
window.location = urlstr;
}
else
{
var WinWidth = 755;
var WinHeight = 550;
var top = (window.screen.height-WinHeight)/2;
var left = (window.screen.width-WinWidth)/2; window.open(urlstr,"VideoView","toolbar=no,width="+WinWidth+",height="+WinHeight+",top="+top+",left="+left+"");
window.opener = null;
self.close();
}
}
然后在打开的新窗口中,有如下操作:
<script for="Webocx" event="reboot()" language="javascript">
window.parent.window.location="index.htm";
</script>结果回到index.htm页面后无法再打开新窗口了?为什么?
一个办法,你在open的时候,不要指定窗口名称,让ie自己分配,这样应该就能自动弹出新窗口了。
后来在前面加了判断
if(window.name == "VideoView")
{
window.location = urlstr;
}
即如果窗口名称相同的话(如你分析的:还在这个VideoView窗口里),就定位过去(urlstr),如果窗口名称不同的话,就打开新窗口,但是问题还是没有解决。
---=---------
后来没有办法,另外建立了一个页面default,在default中加了一个框架,把VideoView页面放到框架中,这个问题才解决了,可是这种方法好象很无奈…… 但是问题毕竟解决了? ;)
------------
再次致谢!