This commit is contained in:
Jeena Paradies 2012-11-22 11:08:01 +01:00
parent accc5e5286
commit 201b0a46ba
3 changed files with 27 additions and 2 deletions

View file

@ -55,6 +55,21 @@ String.prototype.endsWith = function(suffix) {
return this.match(suffix+"$") == suffix;
};
var entityMap = {
"&": "&",
"<": "&lt;",
">": "&gt;",
'"': '&quot;',
"'": '&#39;',
"/": '&#x2F;'
};
String.prototype.escapeHTML = function() {
return String(this).replace(/[&<>"'\/]/g, function (s) {
return entityMap[s];
});
}
var console = {
log: function(s) {
if (OS_TYPE == "mac") {