-1

this is script i have used , now i have to redirect after message appears and clicking on that message OK button

 $('#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 ),
mickey
  • 101
  • 1
  • 3
  • 13

2 Answers2

0

You can redirect a page in JavaScript like this:

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

UPDATE If you want to ask the user first use confirm:

if(confirm('Are you sure?')){
    window.location.replace('http://newpageurl.com/');
}
2hamed
  • 8,719
  • 13
  • 69
  • 112
  • i have to click on OK button then it should redirect, pls tell the jquery after that – mickey Sep 20 '16 at 07:24
  • that msg is already written in retdata.msg, and after that pop message appears but after that it is not redirecting – mickey Sep 20 '16 at 07:41
0

Will be like this.

alert( retdata.msg ); window.location.href = "http://stackoverflow.com";