我没有在 URL 中收到 GET 请求

I am not getting GET request in URL

提问人:ramesh adhikari 提问时间:10/20/2022 更新时间:10/20/2022 访问量:12

问:

我正在尝试在 XML 的帮助下向 ESP32 提交数据集,但是当我提交按钮时它不起作用。它甚至不提交数据集。

这是我的代码

<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>

<script src="script.js"></script>
</head>

<body>




Enter string  <input id="text" type="text" name="input_string">
<input type="submit" value="Submit" id="test">
<iframe style="display:none" name="hidden-form"></iframe>

<script>
let a;
var xhttp = new XMLHttpRequest();
if (this.readyState == 4 && this.status == 200) {
  let a  = document.getElementById("text").value;
  xhttp.open("GET", `http://192.168.43.154/get?input_string=${a}`, true);
  xhttp.send();
};

</script>
</body>



</html>
html xml xml 解析

评论

0赞 jdweng 10/20/2022
如果 URL 未返回,则服务器未侦听,服务器未响应,因为您的请求错误(通常情况不常见),或者服务器正在使用 TLS 并且 TLS 失败。
0赞 ramesh adhikari 10/21/2022
我发现我在提交按钮中缺少 onclick 功能。谢谢

答: 暂无答案