Why is my jQuery having an error when I put this line in?
<script type="text/javascript">
$(function(){
$(".arrowbutton").click(function(){
id = $(this).attr('rel');
$.ajax({
type:"POST",
url:"/upvote",
data:{'id':id},
beforeSend:function() {
},
success:function(html){
$(this).hide();
}
});
return false;
});
});
</script>
When I remove $(this).hide();
it's fine. But, I want it to hide!!!