您的位置:首页 > Web前端 > JavaScript

JavaScript PopUp and Redirect parent windows when close down(弹出窗口 关闭后主页面跳转)

2012-10-16 06:34 633 查看
How to PopUp a new window

<script language="javascript" type="text/javascript">
<!--
function popitup(url) {
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}

// -->
</script>


PS: the Top and Left could control the layout of the new windows

like: top=100; left=100;

Use the JavaScript

<a href="popupex.html" onclick="return popitup('popupex.html')"
>Link to popup</a>


When Close the PopUp, the Parents window redirect to other page

<script>

window.opener.location = "../index.html";

window.close();

</script>

Or

<script>

function windowsClose(){

window.opener.location = "../index.html";

window.close();

}

</script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐