Javascript Bookmarklet for Mozilla to encode code elements

December 6th, 2003

Just create a bookmark with the following as the link (only for Mozilla):
The encoding in WP is messing things up, here is the link to the text file with the javascript bookmarklet.
Once you have typed in or pasted code into a form somewhere on a <em>Mozilla page<⁄em>, clicking on this link will encode the elements on the form. The way it stands, it should encode < , >, \ and / It can be modified to encode everything in the ascii alphabet. :-) Have fun and let me know how it works out for you!
Attribution: Original idea courtesy of ScriptyGoddess, Javascript “Textarea” hack to get around DOM selection problems courtesy of Steve Minutillo All I did was hack the code! :-)

As per an email question from SouthernGal , I realize that I should have mentioned the way around Mozilla to actually make this a bookmarklet. So here goes…
Under Bookmarks toolbar in Mozilla, click on manage bookmarks and then
Call it whatever name you want and copy and paste everything from into the “Location” area of the new bookmark. Once done, click OK. Now drag this newly created bookmark from the “Bookmarks folder” into the personal toolbar folder (all inside of Bookmark manager), thus creating the bookmarklet. Move it around on your personal toolbar to situate it correctly. All done!
This bookmarklet does not even need highlighting of your code to encode, it encodes everything inside of forms, simply click on it when you need encoding.

For all of you script monkies out there, here is a javascript bookmarklet which encodes EVERYTHING! :-)




  1. Jennifer (2 comments.) says:

    Is the first one still available? (that will just encode the < and > ? – the text file you have linked here bring up a blank page. The one that encodes everything is still available – but when I use that, it’s hard to go back through and read what I’ve written… I’d rather just have it encode the brackets) :)

  2. Mark (58 comments.) says:

    Jennifer, try the link now. :-)

  3. Jennifer (2 comments.) says:

    AWESOME! Thank you! :D

  4. Pablo Perez Benitez (1 comments.) says:

    I couldn’t download the bookmarklet. The links to it lead to an empty file! Please post it again.

  5. Mark says:

    The file is not empty.

  6. Sara (3 comments.) says:

    THANK YOU MARK! Great job! Please email me your Amazon or other wish list link! :)

  7. alex says:

    After I heard what this was for, I was afraid this was going to be the way it had to be done… yikes! Nice work…


  1. […] but IE. (A frustrating point since I’ve been using Firefox pretty religously). I saw that Mark had written one compatible with […]

Obviously Powered by WordPress. © 2003-2013

page counter