I want to get the value in ajax response to populate the value in select box I have fetched the field value and send to other page using ajax.In console I caught POST http://localhost/pject_name/public/ajaxteach 405 (Method Not Allowed)
but When I the url in network it prints 'test connection'.How to get response in ajax call
$('#name-first').on('change',function(){
dataString=$('#name-first').val();
$.ajax({
type: "POST",
url : "",
data : dataString,
success : function(data){
console.log(data);
},error: function () {
alert('Erreur. Veuillez réessayer.');
}
});
});
route
Route::get('/ajaxteach', array(
'as' => 'ajaxteach',
'uses' => 'assetRequestController@getproject'
) );
controller
public function getproject(Request $request){
print_r($request->dataString);
echo 'test connection';
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire