Я пытаюсь удалить либо «или» из строки, чтобы оставить оставшийся текст в javaScript.
Попробовал это безрезультатно:
$('body').delegate('.SearchPagination > a', 'click', function(e){
e.preventDefault();
var $this = $(this),
txt = $this.text().toLowerCase(),
txt = txt.replace(/«|»/g, ''),
txt = $.trim(txt),
page = '&page=';
console.log(txt);
if (txt === 'next' || txt === 'previous'){
// get the current page value
var active = $this.parent().find('.active').txt();
if (txt === 'next'){
// add one
page += (active + 1);
} else if (txt === 'previous'){
// subtract one
page += (active - 1);
}
} else {
// invoke search with the page number
page += txt;
}
console.log(page);
//icisSite.icisSearch.search(page);
});