📜  将带有按钮的获取请求发送到端点 - Javascript 代码示例

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

代码示例1
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!!!
});