What are bookmarklets? They’re small Javascripts, saved as browser bookmarks, that perform useful functions. Here’s my favorite bookmarklet site. It includes the bookmarklet that helped me develop my first Ajax applications: Javascript Shell.
How do you make a bookmarklet?
- Write the javascript that you want to be the bookmarklet.
- Escape all the special URL characters, like space, parentheses, etc.
- Wrap the script in an anonymous Javascript function
- Wrap the function in a Javascript URL (
javascript:...
) - Better yet, just do step #1 and use the bookmarklet maker below to do the rest.
Bookmarklet Maker
This form will take your nicely-formatted Javascript, and turn it into a URL so that you can bookmark it.
Go ahead and enter some javascript.
The Javascript function for creating the bookmarklet maker can be downloaded from Github