- Works around IE’s restrictive character limit (an external loader bookmarklet is given to IE users)
- Any valid JS quote characters can be used!
- invalid/problematic HTML characters/tokens can be used!
- Loading… (in IE this will load the BM in a SCRIPT element)
- Loading… (your JS console can now report accurate line numbers!)
- Create a public* directory to hold all your bookmarklets. (*within your
web root; this will work on private testing servers)
- Configure and place the script in
your new directory.
- For each bookmarklet, include an element with a unique id in which the link
will be embedded and a
Bookmarklet creation & testing
- Best practice is to start with a template
that uses a closure to
hide all inner variables and functions. I also have a template
for affecting all frames in a frameset.
- While testing the script, append
end of the src attribute of the script element described above. This
forces the script to load as an external script for easier debugging.
- Aggressively comment your source!
- When you’re done, create a compressed source version using
something like Dean
Edwards’ Packer . Don’t lose your uncompressed source!
- If you wish to comment your compressed source, use only
/* multi-lineat the very top of the file.
&test=1from the script src attribute to embed
the full compressed source into the link’s href attribute.