I have a table with rows, if I click on a row I need to fetch additional data via ajax request
I have this javascript code that listens on any id that matches categoryid patterns, my ids are like categoryid1 categoryid2 etc
Problem here is that I need to dynamically get the id at the time of the click and then make get request, route requires the id for this
Route::get('test/{id}', ['as' => 'test', 'uses' => 'Controller@test']);
$('[id^=categoryid]').click(function(event) {
var id = event.target.id.slice(10);
$.get("", function(data, status){
console.log(data);
});
How do I insert this id at the time of click? blade has already rendered the html code on the server side and will ask for an extra parameter to route function, first being the route name and second an id to send to the route.
via maxit