Bookmarklet editor help

The bookmarklet windowBookmarkledit is a tool for the creation and editing of bookmarklets and other small javascripts.
Bookmarklet code is javascript which

  1. is all on one line,
  2. is up to 208 characters in IE6, 2200 characters in IE4+, or 10000 characters in some others browsers,
  3. has no return value (or the browser would display that),
  4. often uses strange names for variables and functions to avoid conflicts with any javascript native to the page.

Bookmarkledit helps in creating this code by providing an editing environment inside the browser, where you can toggle between the 'all on one line' form and a friendlier format with all the whitespace you want. The link on the page will contain the javascript code and behave like it would from the bookmarks menu. The built-in parsing engine detects simple errors like unterminated strings and (mismatching (brackets). It does NOT detect missing semi-colons or other javascript errors! For testing that, the link next to the buttons can be used before bookmarking the script. Depending on your script, this may of course render the page unreadable, but some robustness has been built in.

The buttons

Select AllSelects the text in the editing area, and puts the caret at the end.
CopyCopies the text in the editing area to the clipboard, or the selection if there is one.
BookmarkAdds the current project to your bookmarks (if the code is short enough).
RenamePrompts for a name, and applies that to the bookmarklet link text, which the browser will choose as the name for the bookmark. A name cannot contain the characters \ / : * ? " < > and |
Wrapwhether text in the editing area will wrap, and adds or removes the corresponding horizontal scrollbar.
Go toPuts the cursor at the specified position in the editing area (in compressed mode).
EscapeConverts spaces outside strings to their url-encoded equivalent %20 or vice versa (not necessary in IE). It is best to toggle back to spaces before compressing.
HelpOffers to open this Help document in a new window (may require an internet connection) after a summary of the instructions.
FormatCreates a readable format with newlines and indentation, and updates the link, after checking for errors.
CompressRemoves all newlines and extra spaces, and updates the link, after checking for errors.

The code

The code can be any javascript. If the protocol "javascript:" is not present, this will be inserted before the code.

Enter and edit your javascript code in the main textarea, enter a name for it, and click or to check for errors and update the link. If an error is found, this will be reported above the textarea. will add whitespace and indentation. will put the code on one line. Hold down ALT to access the menu items with underlined letters. CTRL+E will format and execute the code in one step. CTRL+S will compress and execute the code in one step. Bookmarkledit was based on the Bookmarklet Builder by Troels Jakobsen. Would you like to open \'Help for Bookmarklet Builder\' at www24.brinkster.com/bookmarklets/jsbuilderhelp.htm. Bookmarkledit