Hey Guys,
I have made a small form for some Javscript practice because I want to get back into it - codes below. You enter a term - it opens a google search page and searches for the term + site:site.com.
Can someone point me in the right direction for a couple of things:
1) I'd like it to open in Chrome not IE (eww)
2) I would like to not open a page but display the results in a frame below my form.
If anyone has any pointers that would be great - its a good way to learn!
Thanks,
Liam
Cheers,Code:<head> <style type="text/css"> .btnSubmit{ cursor:pointer; border:outset 1px #ccc; background:#999; color:#white; font-weight:bold; padding: 1px 2px; margin-left: 0px; } </style> <style type="text/css"> <!-- a:link {color: #000000; text-decoration: underline; } a:active {color: #000000; text-decoration: underline; } a:visited {color: #000000; text-decoration: underline; } a:hover {color: #ff0000; text-decoration: none; } --> </style> <script type="text/javascript"> function googleSearch() { if (document.doingasearch.searchbox.value!="") { window.open("http://www.google.com/search?hl=en&q=" + document.doingasearch.searchbox.value + " site:www.mediafire.com"); } else { alert("Please enter something to search.") document.doingasearch.searchbox.focus(); } } </script> </head> <BODY link="black"> <div> <form name="doingasearch" id="doingasearch"> <p style="color:black; font-family: Lucida Console; font-size:11px">Enter Search Term:</p> <input type="text" name="searchbox" id="doingasearch" cols=30 rows=3 style="background-color:black; color:white; font-family: Lucida Console; font-size:11px"></input> <br /> <br /> <input type="button" value="Go!" onclick="return googleSearch();"> <br /> </form> </div> </BODY> </HTML>
Liam


Reply With Quote
Bookmarks