$(function() {
setupPagesUI();
$(document).on('pjax:success', function() {
// Your code goes here ...
setupPagesUI();
});
});
function setupPagesUI(){
if($('li.prev').length == 1){
$('li.prev span, li.prev a').html('');
}
if($('li.next').length == 1){
$('li.next a, li.next span').html('');
}
}