1
I have a jquery ajax code that returns data from a request, but it returns me a line and then erases and throws the next one on top of the Anteriror, I want it to print me on screen 1 result under another as a list, how can I do this ?
<html>
<head>
<title> chk </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: 'envio.php',
type: 'POST',
dataType: 'html',
data: "bin=" + value,
success: function(resultado){
$('#oi').html(resultado + "<br>");
}
})
}, 10 * index);
index = index + 1;
})
}
</script>
</head>
<body>
<center>
<textarea name="bin" id="bin_id" rows="10" cols="40">
</textarea>
<br>
<input type="button" value="testar" onclick="enviar();"></input>
<br>
<div id="oi" name="oi">
<p></p>
</div>
</center>
</body>
</html>
Could show as the variable outworking is ? that is, how json is formulated
– RickPariz