1

I am getting below exception while using jquery colorbox with

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

Below is the exception-

Uncaught TypeError: Cannot read property 'msie' of undefined jquery.colorbox.js:66
(anonymous function) jquery.colorbox.js:66
(anonymous function) jquery.colorbox.js:814
Uncaught TypeError: Object [object Object] has no method 'colorbox' HRS_HRAM.JN_HRS_APP_SCHJOB.GBL&country=FRA?PortalActualURL=https%3a%2f%2fhr…fpsc%2fhrmssox%2f&PortalHostNode=HRMS&NoCrumbs=yes&PortalKeyStruct=yes:497
(anonymous function) HRS_HRAM.JN_HRS_APP_SCHJOB.GBL&country=FRA?PortalActualURL=https%3a%2f%2fhr…fpsc%2fhrmssox%2f&PortalHostNode=HRMS&NoCrumbs=yes&PortalKeyStruct=yes:497
c jquery.js:7341
p.fireWith jquery.js:7403
b.extend.ready jquery.js:6875
H

Does anyone know what is the problem? And how to fix it?

arsenal
  • 23,366
  • 85
  • 225
  • 331
  • do you include the colorbox js too? – Gianpaolo Di Nino Jul 28 '13 at 09:20
  • 1
    Google the error message; it seems like your plugin is using a property that is deprecated in newer jQueries. [Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools](http://stackoverflow.com/q/14923301) – Pekka Jul 28 '13 at 09:20

2 Answers2

4

The page for jQuery Colorbox says (emphasis mine):

Released under the MIT License. Source on Github (changelog).

Compatible with: jQuery 1.3.2+ in Firefox, Safari, Chrome, Opera, Internet Explorer 7+ The plugin is not compatible with your version of jQuery.

It seems like the plugin is too old for jQuery 1.9.1, probably because it's using the .browser property.

You'll have to fix the plugin, or reintroduce the property as described here.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
2

Simple fix: update to the current version (https://github.com/jackmoore/colorbox), which removed the browser check quite some time ago (https://github.com/jackmoore/colorbox#version-1319---december-08-2011)

Tieson T.
  • 20,774
  • 6
  • 77
  • 92
  • this is normally because of missing functions jquery.browser() in new jquery versions, jquery migration script will fix that https://github.com/jquery/jquery-migrate/ – Tofeeq May 07 '15 at 07:18
  • @Tofeeq Which is covered in the answer linked to by Pekka, or by updating to a version that doesn't rely on deprecated/removed functions. – Tieson T. May 07 '15 at 07:21