Skip to content

Instantly share code, notes, and snippets.

@bnvk
Created April 21, 2010 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnvk/374364 to your computer and use it in GitHub Desktop.
Save bnvk/374364 to your computer and use it in GitHub Desktop.
$('.vote_up').live('click', function(eve) {
eve.preventDefault();
var request = $(this).attr('id');
$.get('http://localhost:8888/oncurr.com/build/vote_up/'+request, function(html) {
if(parseFloat(html)) {
$('#vote_'+request).html('+'+html+'<img src=\"http://localhost:8888/oncurr.com/images/graphics/thumbs_up.png\" border\"0\" />');
}else{
$('#vote_'+request).html(html);
}
});
});
$('.vote_down').live('click', function(eve) {
eve.preventDefault();
var request=$(this).attr('id');
$.get('http://localhost:8888/oncurr.com/build/vote_down/'+request, function(html) {
if(parseFloat(html)) {
$('#vote_'+request).html('-'+html+'<img src=\"http://localhost:8888/oncurr.com/images/graphics/thumbs_down.png\" border\"0\" />');
}else{
$('#vote_'+request).html(html);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment