When the return value response of the JSON result value received by AJAX is sprayed directly on the screen,

Asked 2 years ago, Updated 2 years ago, 44 views

When I log in, I don't press the button, but when I press Enter, I can't log in, and only JSON Response appears on the screen.

    $("#password").keyup(function(event) {
        if(event.keyCode == 13) {
            $("#btn_login").trigger("click");
        }
    });

    $("#btn_login").click(function() {
    ...
    }


ajax javascript

2022-09-20 20:53

1 Answers

It's been a while.

I changed the keyup to keydown, so it's done.

I was so busy at the time that I couldn't answer

Thank you for leaving comments.

$("#password").keydown(function(event) {
        if(event.keyCode == 13) {
            $("#btn_login").trigger("click");
        }
    });


2022-09-20 20:53

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.