一、php实现页面跳转
下例是实现2秒后进行页面跳转
php
prnMsg(_('修改公告成功' . $OrderNum), 'success');
header("refresh:2;url=previous_page.php");
header("refresh:2;url=previous_page.php");
refresh:规定延时秒数
url=:填写需要跳转的页面路径
二、php中用js实现页面跳转
下例是实现2秒后进行页面跳转
php
prnMsg(_('修改公告成功,2s后返回上一页面' . $OrderNum), 'success');
echo '<script>setTimeout(function(){window.location.href="' . $RootPath . '/NoticeMaintenance.php";}, 2000);</script>';
echo '<script>setTimeout(function(){window.location.href="' . $RootPath . '/NoticeMaintenance.php";}, 2000);</script>';
使用setTimeout函数进行延时,function(){window.location.href=进行页面跳转