Created
March 8, 2015 00:07
-
-
Save FelisPhasma/9cddd973d8ea374832c4 to your computer and use it in GitHub Desktop.
Turns text into html special characters.
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
function HTMLEncode(str){ | |
var ret = ""; | |
for(i=0;i<str.length;i++){ | |
ret = ret + "&#" + str.charCodeAt(i) + ";" | |
}; | |
return ret; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment