1 $('.btn-logout').on('click', function() {
2 $('<form action="<?=$url_local?>member/logout" method="post"> <input name="token" value="<?= $obj_user ? $obj_user['token'] : '' ?>"/> </form>').appendTo('body').submit();
3 });
1<form method='POST' action='myFile.php'>
2 <input name='myInput'>
3 <button type='submit'>Submit</button>
4 <!--Sends input value to the page set as 'action' parameter.
5 For example a php file.-->
6</form>
1form.addEventListener('submit', (event) => {
2 event.preventDefault(); //stop reload
3
4 let input = document.querySelector('input');
5
6 let method = 'GET';
7 let endpoint = `request url ${input.value}`;
8
9 xhr.open(method, endpoint);
10 xhr.send(); //if in the link what you looking for this send will be empty!!!
11});