From ee0f62beff83091fbd424630263a83ee17e73ce7 Mon Sep 17 00:00:00 2001 From: Benard Ebinu Date: Wed, 27 Dec 2017 09:59:32 -0800 Subject: [PATCH] DIV-604: Adding startsWith prototype to string function when not present in case code is run in IE11 because it does not have support for the String.startsWith --- edivorce/apps/core/static/js/functions.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/edivorce/apps/core/static/js/functions.js b/edivorce/apps/core/static/js/functions.js index 15adfe80..090007a6 100644 --- a/edivorce/apps/core/static/js/functions.js +++ b/edivorce/apps/core/static/js/functions.js @@ -1,3 +1,12 @@ +// Internet Explorer 11 implementation of String does not have the startsWith function +// so manually add it to prevent an error on load. +if (!String.prototype.startsWith) { + String.prototype.startsWith = function(searchString, position){ + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; +} + // Show or Hide Information Section // Using following data attributes: // data-target_id: id of information section