[javascript] Uncaught TypeError: Cannot read property 'msie' of undefined

This error message is arising from the following code:

$.fn.extend({
    chosen: function(options) {
      if ($.browser.msie && ($.browser.version === "6.0" || $.browser.version === "7.0")) {

From the file: https://github.com/koenpunt/chosen/edit/master/chosen/chosen.jquery.js

Obviously browser is not defined. Any idea what could be causing this. Same error in Chrome and FF.

This question is related to javascript jquery

The answer is


$.browser was removed from jQuery starting with version 1.9. It is now available as a plugin. It's generally recommended to avoid browser detection, which is why it was removed.