<a href="javascript:void(0)" click="sendPost()">Linkk</a>
the <script>
function sendPost() {
var xhr = new XMLHttpRequest();
var body = 'name=' + encodeURIComponent(name) +
'&surname=' + encodeURIComponent(surname);
xhr.open("POST", '/submit', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send(body);
}
</script>
<form href="/my/url" type="post" id="myForm">
<input type="hidden" name=name" value="Sergey" />
</form>
<a href="javascript:void(0)" click="document.getElementById('myForm').submit()">Linkk</a>
Find more questions by tags JavaScript
well, at least you formulate the question to fit your requirements - marcella_Mayert commented on April 19th 20 at 12:49
all of the user after successful submission of the post
for example
Just not a very straightforward task. you need to send the post request and when uspeshniy processing to redirect the page to another address.
it is not clear. A redirect in this case it is better to do buck
ajax query Sergey Romanov wrote - marcella_Mayert commented on April 19th 20 at 13:01