HTML Google Search

By Weasel on Dec 27, 2009

First of all. This is JAVASCRIPT, this will not work on Wordpress! So, users can input search parameters (EG. Script Codes) then it would redirect the current page to google then search the inputed text.

I am working on a website where i post scripts called ScriptFreak
you can download a zip or see the preview (Under /Scripts/Google Search Box)

Enjoy!

<html>
<body>

<script type="text/javascript">
function google()
{
var str=document.getElementById('googlebox').value;
str="http://www.google.com/search?hl=en&source=hp&q=" + str + "&aq=f&oq=&aqi=";
var replaced=str.replace(" ","+");
window.location.replace(replaced)
}
</script>
<input type="text" value="Google" id="googlebox"/>
<input type="button" value="Go" onclick="google()"/>
</body>
</html>

Comments

Sign in to comment.
susannelson   -  16 days ago

I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you
https://hide-online.com/

 Respond  
Curtis21   -  30 days ago

HTML Google search is so difficult to do! This article definitely helped me on doing the search for research papers for sale custom writing in a better way. I am extremely pleased about that right now. Thank you so much!

 Respond  
gooshie   -  Dec 27, 2009

&source=hp is just giving credit to
Hewlett-Packard for the redirect..
(from now on let's do &source=Hawkee)

You could do simply this:

<form method="get" action="http://www.google.com/search">
<input value="" name="q" />
<input type="hidden" value="en" name="hl" />
<input type="hidden" value="lang_en" name="lr" />
<input type="button" value="Search" onclick="submit()" />
</form>
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.