jquery focus does not work

Asked 2 years ago, Updated 2 years ago, 59 views

I changed the focus in the received data in the jquery below, but it works well in IE, but it doesn't work at all in Chrome.Please let me know.

$.ajax(

            type: "POST", 
            url: "/aoi/TestServlet",
            dataType: "json",
            data: {"message":requestJson}
        }
    .done(
        function(data,status,xhr){
            $("#mes").text(data.mes);
            if(data.mes==null){
                setTimeout(function(){$('#meisyo') .focus();},100);
            } else {
                setTimeout(function(){$("#code").focus();},100);
            }
        }
    .fail(
        function(xhr,status,thrown){
            console.log("fail:status="+status+"["+xhr.status+"]");
        }
    );
}

jquery

2022-09-30 18:41

1 Answers

It worked fine on another computer.
I want to see a problem with my computer.
Sorry for the trouble.


2022-09-30 18:41

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.