Solved

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

Posted on 2016-09-12
4
15 Views
Last Modified: 2016-10-30
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
Comment
Question by:FLEA2007
4 Comments
 
LVL 2

Expert Comment

by:Dillyn Barber
Comment Utility
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
 
LVL 21

Expert Comment

by:Kim Walker
Comment Utility
Do they have the same operating system version? Technically, endsWith() isn't supported in IE 11?
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now