Laravel 5.1 ajax简单URL路由显示未找到错误(404)

<script type="text/javascript">
             function variants(master_id)
             {

              $.ajax({
                type: "GET",
                url: "getVariants"+'/'+master_id,
                success: function(){

              }
             });

             }
    </script>

This is the script that I have defined and kept is as simple as possible.

The route is this and it still shows me 404 not found error.

Route::get('getVariants/{master_id}','Retailer\ProductController@getVariants');

Add full url path http://example.com/getVariants/master_id to ajax call

<meta name="_token" content="{{ csrf_token() }}"/>
headers: {'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')}

Try

url: "/getVariants"+'/'+master_id,

try the following:

Route::any('getVariants/{master_id}','Retailer\ProductController@getVariants');