when deleting record from DB the page cannot be rediirected using AJAX - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: when deleting record from DB the page cannot be rediirected using AJAX (/showthread.php?tid=71875) |
when deleting record from DB the page cannot be rediirected using AJAX - kvanaraj - 10-04-2018 Code: View Code: Controller Code: Model RE: when deleting record from DB the page cannot be rediirected using AJAX - InsiteFX - 10-04-2018 PHP Code: redirect('users/upload','refresh'); There you go again using capital letters when they should be lowercase. RE: when deleting record from DB the page cannot be rediirected using AJAX - dave friend - 10-04-2018 An AJAX response sends all output to the AJAX success callback. What you need to do is use the "status" property as returned to success to decide what action to take - in your case a redirect via JavaScript. Assuming you're using JQuery, the JS looks roughly like this... Code: success: function(data) In case it's not clear, remove any redirect calls from the controller method |