Home

Keebler/Blog

« Fun with Bookmarklets
CSS sliding photo-gallery »

Text Selection Google Search

Those bookmarklets got me thinking, it would be pretty handy to be able to quickly Google any word on a website (especially one with as many technical terms as this one).  I wrote a javascript that works like so:

  1. the user selects (click-drag) a piece of text (must be inside a paragraph, without HTML, and less than 20 characters)
  2. the selection turns into a "highlighted" link
  3. if the user clicks the link, they are taken to the Google search results for that term

Try it on these words: Ajax DHTML Keebler 

You can download the script here

If you want it to look pretty, you’ll need to add this style to your page too:

<style>
.HighlightedText
{
background: lightyellow;
border-bottom: 1px red dashed;
cursor: hand;
cursor: pointer;
}
.Definition
{
color: red;
text-decoration: underline;
font-size: smaller;
}
</style>

Have fun and make sure to leave comments :D

Related Posts

  • Google Search Appliances: Powered by Vista?
  • The Search for Steve Fossett’s plane on Google Maps
  • Google Calendar for Google App accounts on iPhone
  • Selects Text As You Type Javascript
  • Infinite Scrolling on Live Image Search

This entry was posted on Tuesday, July 5th, 2005 at 10:04 pm and is filed under My Releases, Web Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses to “Text Selection Google Search”

  1. MrHappy says:
    July 5, 2005 at 10:57 pm

    Doesn’t appear to work in Safari or IE for Mac. You should get a Mac….

  2. dan says:
    October 23, 2006 at 2:46 am

    awesome script. im using it on my blog

    Have you thought about adding the google adsense key to it somehow so that when people click on a word in your blog, and search, you get paid? :)

Leave a Reply

Click here to cancel reply.

  • Blog Home

  • Tags

    90210 alessandra ambrosio animals asp.net audrina patridge battlestar galactica bikini bunny bush C# canada canada election ctv ctvglobemedia development Election Entertainment/Celebrity facebook Gordon Ramsay gorilla gossip girl hayden panettiere iphone last.fm liveblog liveblogging mesh08 muchmusic Music obama palin rachel bilson scribblelive shenae grimes subway telemarketers the hills the killers the office toronto ttc toronto tv us election video yeah yeah yeahs

    WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

  • Recent Posts

    • Kenny (vs. Spenny) livebloggin…
    • Trying to convince @idiotbante…
    • I wonder if the CTV “Save Loca…
    • Just finished dinner which I m…
    • I shouldn’t get as excited abo…
  • Categories

    • Election
    • Entertainment/Celebrity
    • Fake News
    • Featured
    • Funny
    • Keebler/Show
    • Music
    • My Releases
    • On-the-Road
    • RedDot
    • Reviews
    • Science/Technology
    • ScribbleLive
    • Security
    • Software
    • Torrent Live Stats
    • Tweets
    • Uncategorized
    • Web Development
  • Blogroll

    • Kitten-Monkey’s Cell
    • :: kattekylling ::
    • Adam Finley
    • blog-j
    • fuzzz.gaulin.ca
    • Idiot Banter
    • mad.greyarea.com
    • ob.blog
    • PollyPrissyPants
    • RedDot CMS Users Google Group
    • ScribbleLive Official Blog
  • My Sites

    • Flickr2Facebook
    • RedDot CMS
    • ScribbleLive
    • Where are my f(acebook)ing friends?
    • WhyYouShould