开发者

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);
  }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜