My site don't want to show this script. When I put it on the index page it shows but when I put it on other pages nothing happens
<div id="pages"></div>
<script>
a = location.href;
b = a.split('-');
c = b.length;
d = eval(c - 1);
e = b[d];
f = a.split('-' + e)[0];
$('#pages').html('<a id="b" href="' + f + '-' + eval(e - 1) + '">Previous' +
'</a><span id="i"> | </span><a id="a" href="' + f + '-' + eval(e * 1 + 1) + '">Next</a>');
$.ajax({
type: 'GET',
url: f + '-' + eval(e * 1 + 1),
error: function(){
$('#a, #i').hide();
}
});
$.ajax({
type: 'GET',
url: f + '-' + eval(e - 1),
error: function(){
$('#b, #i').hide();
}
});
</script>
Can someone help?