You've heard of applets and scriptlets, but have you encountered bookmarklets? A bookmarklet is a tiny JavaScript program that fits completely within the URL of a bookmark. Building on a concept suggested in Netscape's JavaScript Guide, JavaScript enthusiast Steve Kangas has assembled a collection of over 150 bookmarklets for Netscape and IE, available free at www.bookmarklets.com. If you see one you like, just add it to your bookmarks collection.
When you launch a bookmarklet, it runs in the context of the browser. Standard objects like screen, document, and location give it access to useful information. Here's an example:
javascript:void (location.
href=location.href.
substring (0, location.href.
substring (0, location.href.
length-1).lastIndexOf
('/')+1))
The bookmarklet above navigates one directory up from the current URL.
You'll be surprised at the power packed into these tiny programs. There's one to highlight all occurrences of a given word on a page, for example, as well as a mathematical expression evaluator. Another displays the stored cookie for the current site. There's even a bookmarklet editor in the form of a bookmarklet! It takes Java Script expertise to write bookmarklets, but anybody can use them.NJR