使用JQuery和AJAX更新SQL

I have an RSVP box on my website where I want people to click the tick or cross image depending on whether they are coming or not. I currently have a PHP system that updates a SQL database but it reloads the page.

I have tried this code:

$(document).ready(function() {
    var options = {
        url: 'process.php',
        type: 'post',
        data: 'attending',
        success: success
    };

    // bind to the form's submit event
    $('.attending').click(function {
        $(this).ajaxSubmit(options);
        return false;
    });

    function success(responseText, $form) {
        $(".attending").hide();
        $(".success").fadeIn();
    } 
}); 

The RSVP buttons are links with tags But I am strugling with this, any help would be appreciated!

Thanks

查看全部
douzhuo1858
douzhuo1858
2012/05/03 08:39
  • php
  • ajax
  • jquery
  • sql
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复