Does the 2 here indicate that the result has been output twice?

In the

results column, there is an arra (3) on the left side of
, and there is a number 2 in front of it. Does that indicate that the result has been output twice? The test.html:22 also appears twice on the right side of
. Excuse me, how do you explain this?

html is very simple

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <form id="myForm" action="test.php" method="post">
    <input type="text" name="name">
    <input type="password" name="psw">
    <input type="text" name="test" value="check">
    <input type="button" id="submit" value="">
    </form>
    <script>
    function sendData(){
    console.log("haha");
    var form = document.getElementById("myForm");
    var formData = new FormData(form);
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.open("post", "test.php",true); 
    xmlHttp.send(formData); 
    xmlHttp.onreadystatechange =  function(){ console.log(xmlHttp.responseText)};
    }

    ob = document.getElementById("submit");
    ob.addEventListener("click",sendData);

    </script>
</form>
</body>
</html>

php is simpler
var_dump ($_ POST);
? >

Dec.16,2021

Yes, the 2 here means that the outputs exactly the same content twice in a row .
like the one below, 1

has been output 50 times in a row.
  

triggered 3 times, readyState respectively:
2: request received
3: request processing
4: request completed and response ready

Menu