SO Help: how to remove onclick event of anchor?
http://stackoverflow.com/questions/21912980/how-to-remove-onclick-event-of-anchor#21912980
HTML
<div id="new34" style=" width:1028px; height:15px; background#fff; float:left;">
<div id="previous" style="float:left; width:20px;">
<a href="#"><</a>
</div>
</div>
JavaScript
var pagesLeft = 3
function getBusinesses(page){
if(page==0){
alert("you are already on First Page");
$("#previous a").unbind('click')
}
else{
alert(page)
pagesLeft--
$.ajax
({
type: "POST",
url: "getbusiness.php",
data: "page="+page,
success: function(msg)
{
$("#new2").html(msg);
}
});
}
}
$("#previous a").click(function(e){
e.preventDefault
getBusinesses(pagesLeft)
})