Fancybox breaks with the new jQuery v1.9.0.
It affects both, Fancybox v1.3.4 and below - and - v2.1.3 and below.
The errors shown are :
Timestamp: 15/01/2013 10:03:28 AM
Error: TypeError: b.browser is undefined
Source File: ...fancybox/jquery.fancybox-1.3.4.pack.js
Uncaught TypeError: Cannot read property 'msie' of undefined jquery.fancybox-1.3.4.pack.js:18
Uncaught TypeError: Object [object Object] has no method 'fancybox'
Timestamp: 15/01/2013 10:09:58 AM
Error: TypeError: $.browser is undefined
Source File: h.../fancybox2.1.3/jquery.fancybox.js
It seems like it exists a bug in jQuery reported here : http://bugs.jquery.com/ticket/13183 that breaks the Fancybox script.
Also check https://github.com/fancyapps/fancyBox/issues/485 for further reference.
As a workaround, rollback to jQuery v1.8.3 while either the jQuery bug is fixed or Fancybox is patched.
UPDATE (Jan 16, 2013): Fancybox v2.1.4 has been released and now it works fine with jQuery v1.9.0.
UPDATE (Jan 17, 2013): Workaround for users of Fancybox v1.3.4 :
Patch the fancybox js file to make it work with jQuery v1.9.0 as follow :
Find around the line 29 where it says :
isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
and replace it by (EDITED March 19, 2013: more accurate filter):
isIE6 = navigator.userAgent.match(/msie /i) && !window.XMLHttpRequest,
UPDATE (March 19, 2013): Also replace
navigator.userAgent.match(/msie /i) around line 615 (and/or replace all
$.browser.msie instances, if any), thanks joofow
... that's it!
NOTE: this is an unofficial patch and is unsupported by Fancybox's author, however it works as is. You may use it at your own risk ;)