-1
我用螢火蟲犯了錯誤:「500(內部服務器錯誤)」。Laravel 5.0 ajax不起作用
我開始使用Ajax,我想明白一個簡單的事情:
$("#boutonRecherche").click(function() {
$.ajax({
url : "/recherche", //I have tried rechercheController.php and ...
//...Http/Controllers/Phases/RechercheController.php
type : "POST",
data : '&controle=1',//after comments I found this lines triggers error in
//...firebug
dataType : "html"
});
});
什麼是鏈接的最佳途徑?
如何解決 「500(內部服務器錯誤)」
查看代碼:
{!! Form::open(['url'=>'recherche']) !!}
{!! Form::submit('solaire',['class'=>'btn btn-primary', 'name'=>'recherche',
'id'=>'boutonRecherche']) !!}
{!! Form::close() !!}
我的路徑:
我的控制器HTTP /控制器/階段/RechercheController.php
我查看公共/資源/視圖/相位/ recherche.blade.php
我的JS丹斯公共/的script.js
在此先感謝;)
錯誤500通常在代碼中的錯誤造成的,請檢查一下,如果你還沒有做出一個錯字。下一個問題可能與請求類型有關。此路由是否允許POST請求? –
是的,這是一個post請求,我的路線看起來像 Route :: post(「/ recherche」,「Phases \ RechercheController @ update」);我檢查了我的錯字。 – Doug21