I've searched around but I can't find any information about this; maybe I'm not using the best search terms.
Does a JavaScript bookmarklet - i.e., a link that uses the "javascript:" pseudo-protocol that can be dragged to a browser's address bar and opened on any page - need to be a valid URL? I've heard that it does, but I'd like to find a definitive answer.
Google Reader has a "Note in Reader" bookmarklet that uses the following JavaScript code:
javascript:var%20b=document.body;var%20GR________bookmarklet_domain='http://www.google.com';if(b&&!document.xmlVersion){void(z=document.createElement('script'));void(z.src='http://www.google.com/reader/ui/link-bookmarklet.js');void(b.appendChild(z));}else{}
The encoded spaces (%20) seem to be an effort to adhere to a valid URL, but are the curly braces and semicolons, for example, valid URL characters?
If the answer is yes, is there a JavaScript function or an online utility that I can use to make my bookmarklet a valid URL in one step? JavaScript has encodeURI, but that will also encode parentheses, curly braces, etc.