$.ajax({
url: "{{url('urlname')}}",
type: "get",
data: {
data:'id',
},
success: function(response) {
console.log(response);
},
error: function(xhr) {
//Do Something to handle error
}});
/////////web//////////
Route::get('urlname', 'Controller@urlname')->name('urlname');
///controller//////////
public function urlname(Request $request){
return $request->id;
}
$.ajax({
url: "ajax.aspx?ajaxid=4&UserID=" + UserID + "&EmailAddress=" + encodeURIComponent(EmailAddress),
success: function(response) {
//Do Something
},
error: function(xhr) {
//Do Something to handle error
}
});