189
rated 0 times
[
195]
[
6]
/ answers: 1 / hits: 71400
/ 10 Years ago, wed, december 24, 2014, 12:00:00
How Can I pass the variable (stock.id) return from Ajax response to the route to generate the url to edit a stock
$.ajax({
url: 'sectors/stocks/' + $(this).data('sector-id'),
dataType:'json',
beforeSend:function() {
$('.stocks_list').html('Loading...');
}
})
.done(function(data) {
$('.stocks_list').html('<ul>');
$.each(data, function(index, obj_data) {
$.each(obj_data.stocks, function(indx, stock) {
$('.stocks_list').append('<li><a href={{route(admin.stocks.edit,'+stock.id+')}}>' + stock.symbol + ' </a></li>');
});
});
})
More From » laravel