|
|
How can I add a Froogle search box to my site?I saw your article about adding an eBay search box to your site - very cool - and would like to find out how I can add a search box for Google's Froogle shopping service to my page. Ideally, I'd like to have it open up in a new window when someone does a search. Can you help me out? You'll want to take the same basic steps that I showed in my article about Adding an eBay search box to your page, but let me step through it directly. First step is to go to the page that has the search box you want, view the source code and try to isolate exactly what section of code powers the search box itself. That's usually pretty easy as it's wrapped with <form> and </form>. When I did that on the Froogle page, however, it turns out that the HTML is full of JavaScript, CSS and other stuff that's rather a huge distraction. In this case, therefore, I'm going to do something a bit different and reverse engineer the form. Since it's using a method="get" (that is, sending its arguments via the URL) it's easy to do this: Search for something, then look at the resultant URL. I searched for teapots and here's the URL of the search results page on Froogle: http://froogle.google.com/froogle?q=teapots&btnG=Search+Froogle
We can get everything we need from this URL. Here's this same information poured into a rudimentary form: <form method="get" action="http://froogle.google.com/froogle">
<input type="text" name="q" /> <input type="submit" name="btnG" value="Search Froogle" /> </form> Hopefully you can see how the URL became the "action", the name of the search variable ("q") became the name of the text input variable, and the submit button was given the name "btnG" and the value of "Froogle Search" so that the resultant query would be in exactly the same form as generated from the Froogle home page? One small refinement: add target="_blank" to the form tag and you'll ensure that the search results appear in a new window. Let's test it out: Nice! Now, a few refinements to make it look a bit better, yes? Here's what I did: <form method="get" action="http://froogle.google.com/froogle"
target="_blank" style="border:1px solid #669;padding:4px;background-color:#cfc; width:350px;font-weight:bold;text-align:center;"> What would you like to buy today? <input type="text" name="q" /> <input type="submit" name="btnG" value="Search Froogle" /> </form> Hope that gets you going with Froogle!
More Useful HTML, JavaScript and Web Site Programming Articles:
✔ How to Create Predefined Google Image Search Links?
Thanks for the Amazon URL [see Creating Amazon Search Links]. That worked beautifully. In fact, I sent you $5.00 for coffee in thanks....
✔ Can I embed a Facebook search box on my blog site?I've seen your articles about how to add a Twitter or Google search box on a Web page, but I have a tougher...
✔ Can I use CSS for drop shadows on my blog?I want to give my site a bit of a facelift and add some neat graphical elements. One of which is drop shadows....
✔ How can I embed interactive photo panoramas on my site/blog?I read through your blog entry about how to take panoramic photos with iOS 6 and an iPhone 5 and got enthused. I've...
✔ How can I create a Twitter search URL shortcut?I'd like to add a few Twitter search links to my Web site. Is that possible, or does Twitter prohibit this sort of...
Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help
right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
Categorized:
HTML, JavaScript and Web Site Programming
(Article 6446,
Written by Dave Taylor)
Tagged: cgi, froogle, html forms Previous: How can I add ringtones to my Motorola v710 cellphone? Next: How do I remove time limits on an AOL account? Reader Comments To Date: 4Ellie said, on May 9, 2007 5:19 AM:
Hi Dave, I hope it's OK with you, I just tweaked your froogle search box code to create a google images search box. I've been looking everywhere for help with this and am endlessly greatful to you for your brilliant and clear information! Not only do I now have a google images search box, but I also understand how it works :-) Thanks again, varun said, on October 29, 2009 11:09 PM:
hello sir, i am a student of web Design..i want to add a link on my webpage..like "EDUCATION"..when user click on this link he will get other links from google search..on a special form or table on my webpage..is this possible..if not please give any suggestion to do it please..help me rajapolah said, on December 13, 2011 5:30 AM:
PLIS HELP ME
I do have a comment, now that you mention it!Check This Out Too... |
Recent Entries
Look for Answers
Recommended
All Our Categories
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and Blogging Building Web Site Traffic Business and Management Computer and Internet Basics d) None of the Above Facebook Help Google Gmail Help Google Plus Help HTML, JavaScript and Web Site Programming Industry News and Trade Shows iPhone and Cell Phone Help iPod, Sony PSP and MP3 Player Help Kindle Fire Help Mac OS X Help Pay Per Click (PPC) Advertising Pinterest Help Search Engine Optimization (SEO) Shell Script Programming Tech Support Video Help The Writing Business Twitter, LinkedIn and Social Network Help Unix and Linux Help Video Game Tips and Help Windows PC Help Find Me on Google+ ADT on G+ |
Ive been searching and searching. I see "how to make google search my site" and I see "how to add a froogle search" but I dont see "how to make froogle search my site". Google and Froogle seem to do things different so editing one to work with the other doesnt seem to do it.