Laravel使用Ajax调用

In my blade I use an ajax call to call a route. In my controller I am returning a different view. However, the view does not change. I am wondering if I need to change the view differently because I am using an ajax call that needs a return of success or not.

Here is my ajax code in my blade

 $('#btnAnalyze').click(function(){
               var text = $('#cv').val();
                $.ajaxSetup({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    }
                });
                $.ajax({
                    type: 'POST',
                    url: "/widget/measurableresults",
                    data: {
                        text: text,
                    },
                    success: function (msg) {
                        console.log("Success");
                    },
                    error: function (msg) {
                        console.log(msg);
                    }
                });
            });

Here is my route

Route::post('/widget/measurableresults', 'WidgetController@measurableresults');

Here the method in my controller

 public function measurableresults()
    {
        $text = Input::get('text');
        Log::debug( $text );
        return view('results.measurableresults');
    }

The Log::debug prints out the value of $text and the ajax call returns success. However, the view does not change to results.measurableresults. What am I missing?

Try and remove the line Log::debug( $text );, it's probably blocking the return statement to execute

update

You seem not to understand how things work in ajax and php communication, the success code you're receiving doesn't mean ajax returned the expected value, if you log the ajax response, you'll get the html text in the view you're returning, it's not that ajax will magically change the view for you.

Please make more research in regards to this.