Hi Guys,
Just wondering if it's possible to have you sites search box on the results of Google search?
Try to search for dynamic drive in google and the first result has it's won search bar withing dynamic drive!
How can i do this for my website?
Hi Guys,
Just wondering if it's possible to have you sites search box on the results of Google search?
Try to search for dynamic drive in google and the first result has it's won search bar withing dynamic drive!
How can i do this for my website?
Here, I copied this off my website:
Hope this helps,Here’s the script source code. We’ll explain it all below.
HTML:
<form method="get" action="http://www.google.com/search" onSubmit="mysitesearch(this)">
<input name="q" type="hidden">
<input name="searchterms" type="text" size="25"> <input type="submit" value="Search...">
</form>
JavaScript:
<script type="text/javascript">
//Enter the domain of your site
var domain="www.dynamicdrive.com"
function mysitesearch(curobj){
curobj.q.value="site:"+ domain +" "+curobj.searchterms.value
}
</script>
The Code Explained
Starting with the Javascript, because it’s the hardest part with variables.
The only thing you have to change is the domain variable, shown in red below.
<script type="text/javascript">
//Enter the domain of your site
var domain="www.dynamicdrive.com"
function mysitesearch(curobj){
curobj.q.value="site:"+ domain +" "+curobj.searchterms.value
}
</script>
Simply put in your domain of your site. As an example… X96 Web Design. Here’s how it would look.
<script type="text/javascript">
//Enter the domain of your site
var domain="x96webdesign.uuuq.com"
function mysitesearch(curobj){
curobj.q.value="site:"+ domain +" "+curobj.searchterms.value
}
</script>
You don’t have to put http:// in the front, it doesn’t matter if it’s not there.
X96
Last edited by X96 Web Design; 06-11-2009 at 04:31 AM.
Alex Blackie, X96 Design
My Website
I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration
X96, that's not what the OP is talking about, please read the question carefully before answering in the future.
Bornfree, what you are looking for is called “teleportation” and only Google can decide whether or not a site should have this feature:
Many websites are critical of this feature since it encourages people to stay on Google for a longer time instead of going to your site and searching there instead, which has an impact on your measurement of visitors. Nevertheless, if you want this feature, the only thing you can do is to make a good website with a lot of information that is useful to many users.Originally Posted by Google
Good luck!
Oh, Sorry... I thought he meant the search bar in the forums where it searched DD...
// X96 \\
Alex Blackie, X96 Design
My Website
I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration
Bookmarks