javascript - Rails: How to stop refreshing a page with two objects paginated in it? -
i have implemented will_paginate plug in on ror project. will_paginate done in 2 objects of same page, once of them gets clicked, whole page refreshes, , shows page @ top of view.
how can make after click pagination bar, pagination changes no refresh happens, or if refresh happens, shows part of page (div) pagination effects?
is there possible jquery/ajax way this?
sure. in click event must insert "e.preventdefault()" before function retrive data:
$('#yourelement').on('click', function(e) { e.preventdefault(); //your code });
don't forget "e" param in handler.
Comments
Post a Comment