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 Internet Explorer uses the term favorites instead of bookmarks, bookmarklets are also less commonly called favlets or favelets (the term was invented by Tantek Çelik on 2001-09-06 (personal email)).

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:

  • Modify the way a web page is displayed within the browser (i.e., change the font size, background color, etc.).
  • Extract data from a web page (i.e., hyperlinks, images, text, etc.).
  • Jump directly to a search engine, with the search term(s) input either from a new dialog box, or from a selection already made on a web page.
  • Submit the page to a validation service.

Steve Kangas of www.bookmarklets.com coined the term "bookmarklet," which he started to create based on an idea suggested in the Netscape JavaScript Guide.

Brendan Eich, who developed JavaScript at Netscape, gave this account of his invention of the javascript: URL (which makes bookmarklets possible):

They were a deliberate feature in this sense: I invented the javascript: URL along with JavaScript in 1995, and intended that javascript: URLs could be used as any other kind of URL, including being bookmark-able. <p>In particular, I made it possible to generate a new document by loading, e.g. javascript:'hello, world', but also (key for bookmarklets) to run arbitrary script against the DOM of the current document, e.g. javascript:alert(document.links[0].href). The difference is that the latter kind of URL use an expression that evaluates to the undefined type in JS. I added the void operator to JS before Netscape 2 shipped to make it easy to discard any non-undefined value in a javascript: URL.</blockquote> For example, the following bookmarklet will search Wikipedia for the string currently highlighted in the browser:

javascript:Qr=document.getSelection(); if(!Qr){void(Qr=prompt('Keywords...',''))}; if(Qr)location.href='http://en.wikipedia.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 Wikipedia 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); } })();

See Also

Greasemonkey enables functionality similar to that offered by bookmarklets - with one substantial addition - "bookmarklets" can be autmatically loaded when a given website is loaded. In GreaseMonkey terminology, these scripts that execute when a matching URL is loaded are called "User Scripts". Mark Pilgrim's DiveIntoGreaseMonkey.org[1] (http://diveintogreasemonkey.org) is a free book about GreaseMonkey.

External links

  • Bookmarklets.com (http://www.bookmarklets.com/): The official homepage of the bookmarklets.
  • Tantek Çelik's Favelets (http://tantek.com/favelets/) (aka Favlets.com (http://www.favlets.com/)): Bookmarklets (or favlets) for a number of different categories. For IE for Mac.
  • Jesse's Bookmarklets Site (http://www.squarefree.com/bookmarklets/): by Jesse Ruderman. Contains various bookmarklets for different categories.
  • Philburns Bookmarklets (http://www.philburns.com/bookmarklets.html): Contains bookmarklets on categories like Navigation, Searching, Checking Code Validity etc.
  • Svenska "bookmarklets" (http://swedish-bookmarklets.blogspot.com/): A few bookmarklets in Swedish.
  • Samrod's Functional Bookmarks (http://homepage.mac.com/samrod/): Bookmarklets for all kinds of search engines, online services, and some powerful web development tools.

de:Bookmarklet pl:Skryptozakladki ru:Закладурки

ja:ブックマークレット

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools