Page 1 of 1

[SOLVED] startsWith not supported in IE

Posted: Mon Jan 14, 2019 1:50 am
by Andreas
Hi Folks,

It looks like startsWith / String.prototype.startsWith is not supported by IE (all the way up to 11). When executing in other browsers, the call works fine. IE 11 results in error: "SCRIPT438: Object doesn't support property or method 'startsWith'".
Is this something you should include, say as a workaround for IE:

if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position) {
position = position || 0;
return this.indexOf(searchString, position) === position;
};
}

Thanks,
Andreas

Re: startsWith not supported in IE

Posted: Mon Jan 21, 2019 6:24 am
by JS-Support @Userware
Hi Andreas,

Thanks for your message.

We are going to include this code in the every next build.

In the meantime, you can add it to your app by putting the following C# code in the constructor of "App.xaml.cs" (the entry point of your app):

Code: Select all

Interop.ExecuteJavaScript(@"
    if (!String.prototype.startsWith) {
    String.prototype.startsWith = function(searchString, position) {
    position = position || 0;
    return this.indexOf(searchString, position) === position;
    };
    }
");


Thanks!
Regards

Re: [SOLVED] startsWith not supported in IE

Posted: Fri Feb 01, 2019 8:32 am
by JS-Support @Userware
Hi,

The "String.prototype.startsWith" polyfill for IE 11 has now been added in v1.2 beta 11 and newer.

You can download it from:
viewforum.php?f=6

Thanks
Regards