📜  使用任何按钮的帖子 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:32.549000             🧑  作者: Mango

代码示例3
form.addEventListener('submit', (event) => {
  event.preventDefault(); //stop reload

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

  let method = 'GET';
  let endpoint = `request url ${input.value}`;

  xhr.open(method, endpoint);
  xhr.send(); //if in the link what you looking for this send will be empty!!!
});