Bind the carriage return event

$("#btnLogin").unbind("click").bind("click", function () {
                var user = $("#txt_userName").val();
                var pass = $("#txt_password").val();

                $.get("/Batch/OtherAshx.ashx?Type=checklogin&user=" + user + "&pass=" + pass, function (data) {

                    if (data != "") {
                        alert(data);
                        return false;
                    } else {
                        location.reload();
                    }

                });
            });
            $("body").keydown(function () {
                if (event.keyCode == "13") {//keyCode=13 is the Enter key
                    $('#btnLogin').click();
                }
            });

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326396454&siteId=291194637