提问人:ramesh adhikari 提问时间:10/20/2022 更新时间:10/20/2022 访问量:12
我没有在 URL 中收到 GET 请求
I am not getting GET request in URL
问:
我正在尝试在 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>
答: 暂无答案
评论