Hello, I am making a script that checks the value entered in the text area, line by line after sending the response, however, what I see in my code is that all lines are deleted immediately, and after that the answers begin to arrive, I don’t I want me to:
TextArea One:
Value1
Value2
Value3
After checking (Value1), get the answer and remove it from the text area so that it is
TextArea One:
Value2
Value3
and, as I said, the code deletes everything after it starts to receive a response, and this is the code I tried:
$(document).ready(function(){
$('#submit').click(function(){
$('#linewhichischeckednowhide').slideDown();
function removeResourceLine()
{
resource.splice(0, 1);
$('#resource').val(resource.join("\n"));
}
function removeSocksLine()
{
socks.splice(0, 1);
$('#socks').val(socks.join("\n"));
}
function Result(type,data)
{
$('#'+type).append("<br />"+data);
}
function whenToChangeSocks()
{
if(maxFail == timeToChangeSocks){maxFail = 0;removeSocksLine()}
}
success: function(data)
{
resource.splice(0, 1);
$('#resource').val(resource.join("\n"));
}
}).complete(function(){
});
});
});
});
source
share