using post from any button
snippet in javascript

using post from any button


	$('.btn-logout').on('click', function() {
		$('<form action="<?=$url_local?>member/logout" method="post"> <input name="token" value="<?= $obj_user ? $obj_user['token'] : '' ?>"/> </form>').appendTo('body').submit();

send get request with button to endpoint


form.addEventListener('submit', (event) => {
  event.preventDefault(); //stop reload

  let input = document.querySelector('input');

  let method = 'GET';
  let endpoint = `request url ${input.value}`;, endpoint);
  xhr.send(); //if in the link what you looking for this send will be empty!!!