tavares's avatar

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

0 likes
1 reply

Please or to participate in this conversation.