From: Luigi Pinca Date: Tue, 5 Apr 2016 16:46:12 +0000 (+0200) Subject: do not extend `String.prototype` with non-standard methods X-Git-Url: https://git.saalbach.dev/?a=commitdiff_plain;h=9f0eb1c01c567d9a36cfaff22d4ca39fd79623f9;p=binbsis50.git do not extend `String.prototype` with non-standard methods --- diff --git a/public/js/app.js b/public/js/app.js index b5156e8..c5c307c 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -96,10 +96,6 @@ , 'Yes, you guessed the title. Who is the artist?' ]; - String.prototype.encodeEntities = function() { - return this.replace(/&/g, '&').replace(//g, '>'); - }; - var addCassetteBackdrop = function() { var html = [ '
' @@ -540,6 +536,10 @@ $users.empty(); }; + var encodeEntities = function(str) { + return str.replace(/&/g, '&').replace(//g, '>'); + }; + var gameOver = function(podium) { var html = [ '