我拥有一个包含以下链接的图谋:previous
page <span id=“previous”><a href=“www.site.com/page/1” >Previous</a>
;n>ext/code page。 在第一页,与上页没有任何联系。
Now I have 2 image buttons with front and back arrows. If the user clicks on these buttons, jQuery will take the link from the pagination div as mentioned above and redirect the user to these links. However if the pagination link does not exist like on the first page, clicking the previous button
will not do anything.
<<>My Code:
//img has id = info_rightclick_left
$("#info_rightclick_left").click(function() {
if($("#pagination_previous")) {
window.location = $("#pagination_previous a").attr("href");
} else {
alert("NOO");
}
});
现在的问题是,似乎存在着<代码>#pagination_previous,点击图像仍向用户转移。 在这种情况下,在第1页,用户被转至un specified
。
How can I solve this?