开发者

Create a JavaScript that when a user gives input will direct the user to a website

开发者 https://www.devze.com 2023-02-24 03:24 出处:网络
I want to have a user t开发者_JS百科ype something in, such as a \"keyword\" and have them redirected to a page. But if say someone types in \"music\" into the form the redirect is different from when

I want to have a user t开发者_JS百科ype something in, such as a "keyword" and have them redirected to a page. But if say someone types in "music" into the form the redirect is different from when someone types in "movies".

I found this: http://www.javascriptkit.com/script/script2/loginpass2.shtml, which redirects based any acceptable input to ONE website... but I need multiple...

Any suggestions?


<input type="text" id="keyword" />
<a href="#" onclick="window.location=document.getElementById('keyword').value+'.html';return false;">Go</a>

Really not sure what functionality you need, but if you type 'movies' in the text box and click go you will be redirected to 'movies.html'.

This isn't particularly useful for many situations so can you provide more details of what you're actually building.

0

精彩评论

暂无评论...
验证码 换一张
取 消