dsilhx5830 2019-02-27 04:48
浏览 239
已采纳

关闭弹出窗口后重定向到新页面

To add the multiple items to Invoice i am opening pop-up window. Once i add the items, pop-up gets closed and returning to the parent page. But once the pop-up window closes, it should redirect to new page instead of parent page.

Now i am doing like this

In page1.php (parent page)

 <input type="button" class="btn btn-success" name="lineitems" id="lineitems" value="Add Line Items" onclick="window.open('add_lineitems.php?order_id=<?php echo $order_id; ?>',  'LineItems','height=500,width=1300,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');">

In add_lineitems.php(popup) after adding, i am closing window like this

if($l1)
{

echo "<script>window.close();</script>";
}

?>
<script>
    window.onunload = refreshParent;
    function refreshParent() {
        window.opener.location.reload();
    }
</script>

Instead of page1.php, i want this to redirect page2.php. How can i mention it?

  • 写回答

1条回答 默认 最新

  • dougaoshang0237 2019-02-27 05:11
    关注

    To redirect to another page you can used window.location.Add below code in your <script></script>

    echo "<script>window.close();
    window.opener.location='yourpage.php'; 
    </script>";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?