2012-07-21 134 views
1

我想制作一些网站并想问一些问题。 该网站的主要文件是main.asp。 在main.asp中,我插入了notice.jpg文件作为弹出窗口。从弹出窗口更改父窗口位置

我想这样做,如果我点击弹出窗口,弹出窗口消失,新的大窗口(www.charming.or.kr/jeju/)出现。 任何人都可以帮助我吗? 以下是我的来源的一部分。

<head> 
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" /> 
<title><!--#include file="../include/title.asp"--></title> 
<style type="text/css"> 
@import url(../css/comm.css); 
</style> 
<script language='javascript'> 
function OpenWin(dest) 
{ 
posy = screen.Height/2 - 100; 
posx = screen.Width /2 - 200; 

StartWin = window.open(dest, 
"notice_popup","toolbar=no,channelmode=no,left="+posx+",top="+posy+",location=no,directories=no,w idth=743,height=720,resizable=no,menubar=no,scroll=no"); 
} 


</script> 

</head> 

<body onload="OpenWin('../img/main/Notice.jpg')" > 

回答

2

在新的窗口中,您可以通过使用window.opener这是直接引用您的原始参考你原来的窗口。您可以因此使用

window.opener.location.href = newURL; 
+0

感谢您的好意。请告诉我位置(“window.opener.location.href = newURL;” 是 – user1542347 2012-07-21 08:28:25

+0

)如果您想在用户单击图像时更改URL,则必须设置仅包含图像的小型html页面并有一个设置网址的点击处理程序。 – 2012-07-23 08:19:38