第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

將 fetch 與變量一起使用

將 fetch 與變量一起使用

PHP
揚(yáng)帆大魚 2023-05-26 15:51:29
我試圖從表單中獲取信息并通過獲取將它們重定向到不同的服務(wù)器。這是我的代碼:<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>問題在于獲取。它不轉(zhuǎn)發(fā)參數(shù) USER 和 PWD 的值這是我從偵聽此端口的服務(wù)器獲得的: 服務(wù)器端
查看完整描述

1 回答

?
波斯汪

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超4個(gè)贊

如果你想使用模板字符串文字,字符串應(yīng)該帶有反引號(hào)(`):

fetch(`http://192.168.206.138:83/?username=${USER}&password=${PWD}`);


查看完整回答
反對 回復(fù) 2023-05-26
  • 1 回答
  • 0 關(guān)注
  • 170 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)