Search

5/17/2007

great javascript code snippet

http://livepipe.net/scripts/code_highlighter.js


// Escape any HTML-sensitive characters (<, > and &)
function htmlEncode(string) {
return string.replace(/[<&>]/g, function(c) { return {'<': '<', '&': '&', '>': '>'}[c] });
}

沒有留言: