本文介绍了单击甜蜜警报上的确定按钮后如何重定向页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在页面刷新后显示甜蜜警报,但是我必须单击确定按钮,我会在甜蜜警报上重定向页面。请帮助我。
I am able to display sweet alert after the page refresh but I have to click on Ok button which I am getting on sweet alert to redirect the page.Please help me in this.
<?php echo '<script type="text/javascript">'; echo 'setTimeout(function () { swal("WOW!","Message!","success");'; echo '}, 1000);' echo 'window.location.href = "index.php";'; echo '</script>'; ?>推荐答案
要指定回调函数,您必须使用object作为第一个参数,回调函数作为第二个参数。
To specify a callback function, you have to use an object as the first argument, and the callback function as the second argument.
echo '<script> setTimeout(function() { swal({ title: "Wow!", text: "Message!", type: "success" }, function() { window.location = "redirectURL"; }); }, 1000); </script>';更多推荐
单击甜蜜警报上的确定按钮后如何重定向页面?
发布评论