Is it correct to do one post request inside another? And if not - is it possible to somehow send 2 responses from the server to the client at once? I now have this code:
$.post("auth.php", {'login': login, 'password': pass, 'remember': remember}, function(data){ if(data == "false"){ grecaptcha.reset(); var div = document.querySelector("#div"); div.innerHTML = "Неправильный логин или пароль"; }else if(data == "true"){ $.post("auth.php", {"idl": login}, function(data){ alert(data); window.location.href = "profile.html?"+data; } ); } }); Can replace it with a get request?