Bookmarklet
Alternatively referred to as favelets, bookmarklets are interactive bookmarks that contain JavaScript code that allows the bookmark or favorite to perform additional features. For example, the popular social networking site Facebook has a share bookmarklet to share any web page you are on with all your friends without having to do it through Facebook or the webpage.How do I add a bookmarklet?
Each browser has its own method of adding a bookmarklet to your bookmarks or favorites. Below are the steps on how to do this for each of the major browsers. In these examplesMicrosoft Internet Explorer users
- Right-click this example bookmarklet link: Shine Tutorial
- Click Add to Favorites.
- Because a bookmarklet uses JavaScript, you will get a warning. Click Yes to continue.
- If you want change the name and change the "Create in" location to Favorites Bar.
- Click Add.
Mozilla Firefox and Chrome users
- Click and drag this example bookmarklet (Shine Tutorial) to your browsers bookmark bar.
- After letting go the bookmarklet entitled "Computer Hope Search" should be listed.
What is the code for the above Bookmarklet?
Below, is the HTML and JavaScript used for the above bookmarklet. If you want to create a bookmarklet for your own site or another website feel free to modify this code.<a href="javascript:function se(d) {return d.selection ?
d.selection.createRange().text : d.getSelection()} s = se(document); for
(i=0; i<frames.length && !s; i++) s = se(frames[i].document); if (!s ||
s=='') s = prompt('Shine%20Tutorial%20search','');
open('http://www.shinetutorial.com/' + (s ? 'cgi-bin/search.cgi?q=' +
encodeURIComponent(s) : '')).focus();">
Shine Tutorial Search</a>
Also see: Bookmark, Favorites, JavaScript