Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 44
  • Last Modified:

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

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!
0
FLEA2007
Asked:
FLEA2007
1 Solution
 
Dillyn BarberChief Information Officer (CIO)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.
0
 
Kim WalkerWeb Programmer/TechnicianCommented:
Do they have the same operating system version? Technically, endsWith() isn't supported in IE 11?
0
 
leakim971PluritechnicianCommented:
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

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now