Testing/Debugging with Internet Explorer (Document Mode/Emulation)

FLEA2007
FLEA2007 used Ask the Experts™
on
When I use IE 11 (in document mode "Edge"), the javascript function "endsWith" is not defined, and breaks if I call it from within the webpage.

However, when I go sit down at my co-worker's desk and try it, it does have "endsWith" defined.  So I compared the browsers and they are both IE 11 (down to the same version #).

So,

1.  How is this possible?  Is there some way to ammend/update/upgrade/improve the browser's javascript?
2.  How am I going to debug multiple IE's given that two IE 11's are doing different things?



Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
If the javascript is in the html it most likely is a setting issue (or conflict from a browser addon). If it is an external JS file linked in try to append async="async" to it and/or clear browser cache.
Kim WalkerWeb Programmer/Technician

Commented:
Do they have the same operating system version? Technically, endsWith() isn't supported in IE 11?
Multitechnician
Top Expert 2014
Commented:
endsWith is supported by MS Edge but none of MS IE (the last is 11) :
https://msdn.microsoft.com/en-us/library/mt146835(v=vs.94).aspx

Here the list of document modes :
https://msdn.microsoft.com/en-us/library/ff406036(v=vs.85).aspx

Double check you're in Edge mode if you launch IE11 (check the Emulation Tab) :
Check the User agent too :)

You can add the following code to extend the String object with endsWith :
String.prototype.endsWith = function(suffix) {
    return this.substr(-suffix.length) === suffix;
};

Open in new window


You can also force the browser to use Edge compatibilty mode :
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial