Basically i'm coding a code that takes the first line from a textarea, then send it to a php code and get back the response. However this is not happening whenever i put the data the browser stops working this is the code that i'm working in
function getNewSocks() {
socksList.splice(0, 1);
$('#socks').val(socksList.join("\n"));
}
var socksList = $("#socks").val().split("\n");
while (socksList.length) {
var getTheSocksLine = $.trim(socksList[0].replace(/\s+/g, ''));
var getIP = $.trim(getTheSocksLine.split(":")[0]);
var getPort = $.trim(getTheSocksLine.split(":")[1]);
if (typeof getIP == "undefined" || typeof getPort == "undefined" || getIP == "" || getPort == "") {
alert("typeof");
socksDieResultDisplay(getIP + ":" + getPort);
getNewSocks();
}
else if (getTheSocksLine.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,6}$/) == null) {
alert("error");
socksDieResultDisplay(getIP + ":" + getPort);
getNewSocks();
}
else {
$.ajax({
url: "system/checkerPostHandler.php",
method: "POST",
data: "checkSocks=CheckSocksNowPlease&ip=" + getIP + "&port=" + getPort,
success: function (getResponse) {
alert("PHP Response=>" + getResponse + " jQuery Response=>" + getIP);
if (socksList.length != 0) {
getNewSocks();
}
}
});
}
}
i swear to god that now it has been 3-4 hours trying to find out what is the problem! help me please