0

我需要在原型中编写这个 jQuery 函数。我怎样才能转换它?

submitHandler: function(form) {                                             
    $.post("post.php?"+$("#form1").serialize(), {       
        }, function(response){                                                          

             if(response==0)
                 {                                                      
                  alert("security code is wrong!");
                  return false;
                 }                                                  
           }
    );

},

4

1 回答 1

1

尝试:

new Ajax.Request('post.php?' + $('form1').serialize(), {
  onSuccess: function (transport) {
    var response = transport.responseText;

    if (response == 0) {                                                      
      alert("security code is wrong!");
      return false;
    } 
  }
});
于 2012-07-30T14:37:12.137 回答