2
My codigo js is working perfectly however I wanted to printase the result inside a div in the index.html itself below my textarea and without redirecting to another page, because it is redirecting to the page ip.php and showing the results there.
<html>
<head>
<title> testar ips </title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script>
  function enviar(){
    var bin = $("#bin_id").val();
    var linhaenviar = bin.split("\n");
    var index = 0;
    linhaenviar.forEach(function(value){
      setTimeout(
        function(){
          $.ajax({
            url: 'ip.php',
            type: 'POST',
            dataType: 'html',
            data: "bin=" + value,
            success: function(resultado){
              document.write(resultado + "<br>");
          }
        })
      }, 10 * index);
    index = index + 3;
    })
  }
  </script>
</head>
<body>
<center>
<textarea name="ip" id="ip_id" rows="10" cols="40">
</textarea>
<br>
<input type="button" value="testar ips" onclick="enviar();"></input>
</center>
</body>
</html>
Who gave the -1, could explain, please, the reason here in the comment at least?
– Leonardo Pessoa