jquery focus does not work

Asked 1 years ago, Updated 1 years ago, 34 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.