A "bookmarklet" is a little JavaScript script that's intended to be run from a web browser's bookmarks bar or menu. The reason they work as "bookmarks" is that the JavaScript source code is crammed into the form of a URL using the "javascript:" scheme.
JavaScript::Bookmarklet is based on a text filter John Gruber of Daring Fireball fame wrote that makes writing --- and especially revising --- JavaScript bookmarklets much more pleasant.
Developing or modifying bookmarklets can be irritating, to say the least, because of this requirement that the JavaScript code be in the form of a URL.
So the problem developing bookmarklets is this: You want to write and edit normal JavaScript code, but you need to publish hard-to-read URLs.
This package provides to means of using this functionality -- as a utility method that can be called in an application and as a script that can be used on the command-line or in editors like BBEdit.
SYNOPSIS
use JavaScript::Bookmarklet qw(make_bookmarklet);
my $src = < < JAVASCRIPT
var str = document.title;
alert(str);
JAVASCRIPT
my $bookmarklet = make_bookmarklet($src);
print $bookmarklet;
The output of this script would be:
// javascript:var str = document.title;alert(str);
var str = document.title;
alert(str);
Product's homepage
Requirements:
· Perl