Welcome Guest, Not a member yet? Register   Sign In
Javascript Redirect
#1

[eluser]timpiele[/eluser]
What is the correct way to redirect to a CI URL in Javascript?

Code:
$.post('/dev/authenticate/', { username:username, password:password },
     function(data) {
      
          if (data === "1") {
        [removed] = "/dev/admin/index";    
          }
          else {
               alert("Invalid Login");
          }
      
     }
);

[removed] doesn't work, it throws it into an endless loop because the controller is loading the admin/index view... how do I do this?

Inside the admin controller index method is:
Code:
$this->load->view('admin/index', $data);
#2

[eluser]timpiele[/eluser]
removed was window dot location.




Theme © iAndrew 2016 - Forum software by © MyBB