将输入框值作为查询字符串传递给 URL
我有一个输入框和一个 SEARCH
链接,其样式看起来像搜索按钮。当用户在输入框中输入关键字时,我想抓取该关键字,传递它,并将其作为搜索查询字符串附加到搜索 URL
/search/pages/physicians.aspx?v=relevance&s=Physicians&k=
因此,如果 Cardiographer
是关键字,那么它将是比如:
http://ABChospital.org/search/pages/physicians.aspx?v=relevance&s=Physicians&k=Cardiologist
我怎样才能在 jquery 中实现这一点?
<input name="KeywordBox" class="BasicSearchInputBox" type="text" value="Enter Keywords.."/>
<div class="searchBtnHolder">
<a class="searchButton" href="/search/pages/physicians.aspx?v=relevance&s=Physicians&k=" type="submit"><span>
Search</span></a>
I have an inputbox and a link for SEARCH
styled to look like a Search button. When a user types in a keyword in the inputbox, I want to grab that keyword, pass it, and append it as a search query string to the search URL
/search/pages/physicians.aspx?v=relevance&s=Physicians&k=
So if Cardiologist
is the keyword, it would be like:
http://ABChospital.org/search/pages/physicians.aspx?v=relevance&s=Physicians&k=Cardiologist
How can I achieve this in jquery?
<input name="KeywordBox" class="BasicSearchInputBox" type="text" value="Enter Keywords.."/>
<div class="searchBtnHolder">
<a class="searchButton" href="/search/pages/physicians.aspx?v=relevance&s=Physicians&k=" type="submit"><span>
Search</span></a>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Try this: