Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要向 URL 提交一个表单/search/,没有任何变量名。因此,如果我输入“foobar”表单,它将以 GET 格式将表单提交到/search/foobar.
/search/
/search/foobar
我怎样才能做到这一点?据我所知,没有办法用 HTML 做到这一点,我将不得不使用 jQuery。
<form action = "/search/" onsubmit="this.action += encodeURIComponent(this.term.value); this.term.disabled = 'disabled'"> <input type="text" name="term"> </form>