How in 2019 it is better to implement the work of the site, on ajax or ... standard browser methods? By the phrase standard browser methods, I mean this:
<form action="handler.php" method="POST"> <input type="text" name="input1" class="testinput"> <input type="submit" value="OK"> </form>
And by the phrase ajax, I mean something like this:
$.post("handler.php", { input1: $(".testinput").val() }, onAjaxSuccess); function onAjaxSuccess(data){ $("body").html(data); }
What are the pros and cons of both methods and which method would you use?