Recent Articles

Link Growth Patterns And How They Effect...
With every passing day, the number of websites and hence the number of web pages are growing at an explosive rate on the internet. This can cause a major headache to the search engines as they...

How Long Should You Wait To Translate Your Site...
I recently had the opportunity to meet with Mark Rodgers, the Managing Director of Cipherion Translations and we started to talk about the opportunities that the internet presents to us if we wish to expand our business internationally. Mark 's business provides. ..

How To Correctly Use Your Analytics Data
Not knowing what to expect, in some cases can be really exciting, like river rafting or hiking or exploring a reef while snorkeling, however, when it comes to your website it can be more important to have a better...

Developing Streaming Video Content Within The Cloud
We are in the process of building out our own streaming video server at the school, and tinkered around with Darwin from Apple for a bit. While it ended up not being the product we are going to stick with because...


12.18.09

Adding A More Defined Search To Your Google Search Bar

By Dave Taylor

I have a Google search box on my site, thanks to your article How to add Google Search to Your Site, but want to automatically add a few words to the search string that the user enters. Is that even possible? If so, how do I modify the JavaScript code to make it work?

Dave's Answer:

Great question, and one that's come up quite a few times since I wrote that original Google search code. Seems like it's popular to not only have a search box on your site, but to tweak the actual search that you send to Google. Who knew? :-)

Accomplishing this task, however, is quite a bit more complicated because what we have to do is actually tweak the form itself so that the word or words are grafted onto the search after the user has clicked the submit button but before the data is actually sent back to Google.

I asked a developer friend of mine, Luke Kingland, to help out and he describes his solution thusly:

"Instead of the user entering search terms directly into the "q" field that Google will read, we're going to have the user first enter their search terms into a temporary field named "custom_terms". The JavaScript that is then run when the user clicks "Submit" assembles the value for the "q" field (which is hidden) by setting it to both what the user typed in and the value of "additional_terms", which the site owner hard codes on the page."




Continue reading this article.

About the Author:
Dave Taylor is known as an expert on both business and technology issues. Holder of an MSEd and MBA, author of twenty books and founder of four startups, he also runs a marketing company and consults with firms seeking the best approach to working with weblogs and social networks. Dave is an award-winning speaker and frequent guest on radio and podcast programs.

AskDaveTaylor.com
http://www.intuitive.com/blog/
About DevWebProNL
DevWebProNL is for professional developers ... those who build and manage applications and sophisticated websites. DevWebProNL delivers via news and expert advice New Strategies In Development.





DevWebProNL is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITmanagementnews.com






-- DevWebProNL is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
© 2009 iEntry Inc. All Rights Reserved Privacy Policy Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


Delivering IT Solutions DevWebPro DevWebPro Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact