Created
July 1, 2014 07:24
-
-
Save egulhan/aa4beca148efe4aeeeaf to your computer and use it in GitHub Desktop.
Encode/decode with/from base64 using jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@source: http://www.naveen.com.au/javascript/jquery/encode-or-decode-html-entities-with-jquery/289 | |
function htmlEncode(value){ | |
if (value) { | |
return jQuery('<div />').text(value).html(); | |
} else { | |
return ''; | |
} | |
} | |
function htmlDecode(value) { | |
if (value) { | |
return $('<div />').html(value).text(); | |
} else { | |
return ''; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment