AJAX Update Separate Element
I'm developing a voting system using PHP and when I click on the "Vote Up" or "Vote Down" links for a particular item, I'd like the "vot开发者_Go百科e.php" script to be run and the "Votes" value to be updated to reflect it's new value without the page refreshing. I'll need to be making a POST request via Ajax and I'd prefer to be able to do this using jQuery.
Any ideas?
this can easily be achieved by use of .ajax
and the success
parameter from the .ajax
function within jquery
its all here: http://api.jquery.com/jQuery.ajax/
So, example:
$.ajax({
url: 'ajax/test.html',
success: function(data) {
$('.result').html(data);
}
});
精彩评论