Trying to redirect with an ajax call is a nonsense. You have to redirect from javascript with window.location = ....
Feb 3, 2015
4
Level 9
redirecting with laravel
Hi,
I have a quiz which has multiple steps
There are 10 steps, so I need to call my controller to determine what step I am on and then redirect.
Can I do a call to my controller without a callback to the js file. I used $.ajax but it tries to return the redirect to js and I get a 500 server error/
controller
public function redirect() {
return Redirect::to('finish');
}
js file
$.get( "next", function( data ) {});
Level 9
To be fair it felt pretty stupid - how about passing the value in via the pagescontroller in a meta tag and reading with the js?
<meta name="next-step" value=" {{ $data['nextpage'] }} ">
Please or to participate in this conversation.