调用ajax函数但出现此错误-
home / asif / fanslive / vendor / laravel / framework / src / Illuminate / Routing / RouteCollection.php。
请求方法:POST
状态码:405方法不允许
远程地址:192.168.0.4:80
推荐人政策:降级时不推荐人
这是代码-
window.ajaxCall = function (url, data, method, dataType, successHandlerFunction, processDataFlag, contentTypeFlag) {
if(typeof(processDataFlag) == 'undefined'){
processDataFlag = true;
}
if(typeof(contentTypeFlag) == 'undefined'){
contentTypeFlag = 'application/x-www-form-urlencoded';
}
$(".js-data-table .overlay").show();
geturl = $.ajax({
url: url,
data: data,
processData: processDataFlag,
contentType: contentTypeFlag,
type: method,
dataType: dataType,
cache: false,
success: successHandlerFunction,
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
complete: function() {
$(".js-data-table .overlay").hide();
}
});
}
var data = "latitude=54&longitude=21&id=1"';
ajaxCall("getGenralSettingData", data, 'POST', 'json','');
Route::group(['prefix' => '{club}', 'middleware' => ['check.cms.panel']], function()
{
Route::post('/getGenralSettingData', 'SampleController@getGenralSettingData')->name('backend.sample.data');
});