代码语言:javascript复制
$(document).ready(function () {
$(document).on('click', '.brnch_clk', function () {
//alert('ok')
var branchid = $(this).data('branch');
$('#txt_branchid').val(branchid);
alert($(this).data('branch'));
$.ajax({
'url': 'search',
'type': 'GET',
'data': {id: branchid},
success: function(response){ // What to do if we succeed
if(data == "success")
alert(response);
},
error: function(response){
alert('Error' response);
}
});
});
});
route Route::get('search', 'ShowstaffController@search'); 接收变量
代码语言:javascript复制$request->query('id');