Bookmarklet



         


A bookmarklet is a small JavaScript program that can be stored as a URL within a bookmark in most popular web browsers, or within hyperlinks on a web page. Because Microsoft Internet Explorer uses the term favorites instead of bookmarks, bookmarklets are also less commonly called favelets.

Bookmarklets can be saved and used like normal web page bookmarks. Therefore, they are simple "one-click" tools that can add substantial functionality to the browser. For example, they can:

For example, the following bookmarklet will search BambooWeb for the string currently highlighted in the browser:

javascript:Qr=document.getSelection(); if(!Qr){void(Qr=prompt('Keywords...',''))}; if(Qr)location.href='http://en.BambooWeb.org/w/wiki.phtml?search='+escape(Qr)

If nothing is selected, it will display a dialog box form field in which to enter a search string.

Bookmarklet to set right margin to 45% to make BambooWeb more readable:

javascript:(function(){var newSS, styles='body { margin-left:0%; margin-right:45%;}';if(document.createStyleSheet) {document.createStyleSheet(%22javascript:'%22+styles+%22'%22); } else { newSS=document.createElement('link'); newSS.rel='stylesheet'; newSS.href='data:text/css,'+escape(styles); document.getElementsByTagName(%22head%22)[0].appendChild(newSS); } })();
[Top]




  View Live Article   This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License