如何重定向页面使用JAVA脚本在codeigniter后单击警报消息OK按钮

How to redirect page using JAVA SCRIPT in codeigniter after clicking on alert message OK button

本文关键字:单击 codeigniter 按钮 OK 消息 脚本 重定向 JAVA      更新时间:2023-09-26

这是我使用的脚本,现在我必须在消息出现后重定向并点击该消息OK按钮

 $('#save_scheduler').click( function() {
            $.ajax({
                url: "<?php echo site_uri('shopapp/scheduler_master'); ?>",
                type: "post",
                dataType: "json",
                data: $('#SchedulerForm').serialize(),
                success: function( retdata ) {
                    alert( retdata.msg ),

会是这样的

警报(retdata。味精);

你可以在JavaScript中这样重定向一个页面:

window.location.replace('http://newpageurl.com/');

如果您想要求用户首先使用confirm:

if(confirm('Are you sure?')){
    window.location.replace('http://newpageurl.com/');
}