-2

ここでデモとまったく同じようにフォームをすべて設定しました:http://www.alessioatzeni.com/wp-content/tutorials/jquery/login-box-modal-dialog-window/index.htmlしかし、方法がわかりません私のjQueryで処理するために、ユーザー名とパスワードを投稿してください。誰かが私を助けることができますか?

4

2 に答える 2

1

You should post the specific code you are having trouble with, but I think this will help:

$(document).on('click', '.submit.button', function () {
    $.post('/signin', $(this).closest('form').serialize(), function (data) {
        //check success or failure
    });
});
于 2013-02-05T00:54:33.457 に答える
0

Hope this will help you. Much easier because you only have 2 fields. Thanks

jQuery('.submit.button').click(function(){ 
 var username = jQuery(this).find('#username').val(); 
 var password = jQuery(this).find('#password').val(); 

 jQuery.ajax({
    url: "login.php",
    data:{username:username, password: password},
    type: "post",
    success: function(html) {
           //add success function here
    },
    error: function(html) {
       //add error login here
},
    statusCode: {
     404: function() {
       //404 here
     }
    }
});

});

Cheers!

于 2013-02-05T01:12:59.960 に答える