我有一個(gè)關(guān)于我的代碼的問(wèn)題。如何提交兩個(gè)值?我的代碼只提交了一個(gè)字符串,但我不知道如何在 url 中提交兩個(gè)值。我已經(jīng)嘗試剪切提交的請(qǐng)求字符串xmlhttp.open("GET", "<?php echo $actual_link; ?>/pages/panel/ajaxsearch.php?user=" + str + "secondvalue" + secondval, true);// Cutecho stristr($_REQUEST["user"], 'secondval');它有效,但它很丑陋。<script> function showHint(str) { if (str.length == 0) { document.getElementById("txtHint").innerHTML = ""; return; } else { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { document.getElementById("txtHint").innerHTML = this.responseText; } } xmlhttp.open("GET", "<?php echo $actual_link; ?>/pages/panel/ajaxsearch.php?user=" + str, true); xmlhttp.send(); } }</script><input onkeyup="showHint(this.value)">
如何在ajax中提交多個(gè)值?
慕的地6264312
2022-01-02 20:02:48