Use 3 back ticks for your code https://laracasts.com/discuss/channels/general-discussion/guidelines-for-posting-on-laracastscom
Jul 12, 2016
1
Level 1
Pagination - Load also view
Hi,
i have a table with pagination and when i click in next page icon the view is loaded.
controller function: public function index() { $items = Items::where('active', '=', 1)->paginate(5); return view('app/items.index', array('items' => $items)); }
jquery: function pagination() { $(document).on("click", ".pagination a", function(e) { e.preventDefault(); //var page = $(this).attr('href').split('page=')[1]; alert($(this).attr('href')); $.ajax({ url: $(this).attr('href'), }) .done(function(data) { console.log(data); $('#listSearchItems').html(data); }); }); }
There is a way to not return view in ajax calls? Thank's
Please or to participate in this conversation.