diff options
Diffstat (limited to 'program/js/common.js')
-rw-r--r-- | program/js/common.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/program/js/common.js b/program/js/common.js index afaf91639..02934f734 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -592,6 +592,14 @@ Date.prototype.getStdTimezoneOffset = function() return tzo; } +// define String's startsWith() method for old browsers +if (!String.prototype.startsWith) { + String.prototype.startsWith = function(search, position) { + position = position || 0; + return this.slice(position, search.length) === search; + }; +} + // Make getElementById() case-sensitive on IE if (bw.ie) { document._getElementById = document.getElementById; |