Node.js examples for Environment:Browser
Returns the IE version. Tested for IE11 and earlier.
/**//w ww. j ava 2s. c om * Returns the IE version. Tested for IE11 and earlier. */ function isIE () { var match = navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/); return match ? parseInt(match[1]) : undefined; } String.prototype.endsWith = function (s) { return this.length >= s.length && this.substr(this.length - s.length) == s; }; String.prototype.contains = function (s) { return this.indexOf(s) > -1; };