Bookmark and Share

Wednesday, May 18, 2011

Javascript HTML encoding/decoding utility

Today I found a great script for encoding and decoding HTML on the browser:

http://www.strictly-software.com/htmlencode

The library is located under http://www.strictly-software.com/scripts/downloads/encoder.js

The usage is really easy:

Encoder.EncodeType = "entity";

var encoded = Encoder.htmlEncode(document.getElementById('input'))

var decoded = Encoder.htmlDecode(encoded);


That’s all!