|
|
How do I add an Ask.Com seach box to my Web site?What is the HTML needed to add an ASK.COM search box or search form to my web page? Thanks. Apparently one great benefit of learning the arcane hypertext markup language (HTML) is that I can crack open Web pages, figure out how the scripts on those pages work and rewrite them to appear on other Web pages or web sites. It's actually kind of a fun little puzzle, but I wouldn't admit that in public lest it make me sound like a bit of a geek. :-) Anyway, the first step is to bring up a page with the search box you want. In the case of Ask.com I suggest that you start with the search box at the top of a search results page, since it's simpler code than their fancy home page. When I searched for actor Johnny Depp, it looks like this: ![]() The source code is accessible by choosing View --> Page Source in Firefox or similar in whatever browser you use. The source is a jumble of complex codes and scripts, as is common on modern sites, but underneath all of that is the core functionality of the search box. When you dig through it, however, you find that the way that they've implemented the search suggestions script means that you can't just extract the form HTML elements and have a functional script. Too bad. Instead, we'll have to reverse engineer the URL that's produced on a search. The page that I show above, for example, has the complicated URL: http://www.ask.com/web?q=johnny+depp&search=search&qsrc=0&o=0&l=dir
Unwrapped this means that we have a bunch of variable=value pairs:
This gives us the following URL: http://www.ask.com/web?q=johnny+depp. Click on it and see what happens. It works! Nice. This means that the Ask.com search box is incredibly simple: <form method="get" action="http://www.ask.com/web" />
<input type="text" name="q" /> <input type="submit" value="search ask.com" /> </form> Easy enough! Now that you have the most basic search box you can jazz it up with some Cascading Style Sheet (CSS) code if you'd like, to make it a bit more fun: <form method="get" action="http://www.ask.com/web"
style="border:3px dotted #C33;padding:6px;background-color:#FEE;" /> <input type="text" name="q" /> <input type="submit" value="search ask.com" /> </form> Which looks like this: Try it if you'd like. It works!
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 8736,
Written by Dave Taylor)
Tagged: ask.com, cgi, css, html, reverse engineering, search engines Previous: How to delete your comments from a YouTube video? Next: How do I organize a meetup? Reader Comments To Date: 2Saju Dey said, on October 21, 2009 10:52 AM:
I want part time online form fill up jobs at home. Thank you.
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+ |
delete ask.com from my facepage