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:
- the user selects (click-drag) a piece of text (must be inside a paragraph, without HTML, and less than 20 characters)
- the selection turns into a "highlighted" link
- 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
Doesn’t appear to work in Safari or IE for Mac. You should get a Mac….
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?