webman AI 我想實現(xiàn)自動提交開始對話,使用url攜帶參數(shù): https://testurl.com/#role=1?qtext=你好 然后獲取 qtext 的值 然后自動開始對話
暫無方案,所以特來尋求的幫助
通常,查詢參數(shù)(?)應(yīng)出現(xiàn)在片段(#)之前,即格式應(yīng)為: https://testurl.com/?qtext=你好#role=1
https://testurl.com/?qtext=你好#role=1
js獲取qtext的值
const urlParams = new URLSearchParams(window.location.search); const qtext = urlParams.get('qtext'); // 獲取 qtext 的值 console.log(qtext); // 輸出: 你好
使用js,qtext 的值可以獲取,也能設(shè)定為textarea的內(nèi)容,textarea的內(nèi)容有時會自動恢復(fù)之前輸入的內(nèi)容,不知應(yīng)該如何使用sendbtn自動提交?
讓AI給你寫
不了解其運行機制,AI直接給我寫了一個可以自動提交的AI對話系統(tǒng),一大頁的代碼,優(yōu)化了幾次能用。值得一提webman AI的textarea輸入框 在頁面對話內(nèi)容很多的時候輸入會很卡。