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

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

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 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀