f:browser is undefined and .fancybox is not a function

AJFMEDIA picture AJFMEDIA · Jan 16, 2013 · Viewed 7.8k times · Source

Ok I set some images to open up with fancybox. It used to work fine. Now I get 2 errors.

enter image description here

What I changed im not sure. I have read online that you generally get the .fancybox is not a function error message when you have mutiple includes of the jquery library. As far as I am aware I have just the one.

Here is an example of where you can get this error message:

(www).thecardb.com/abarth/1000-Bialbero/1960/0/85

I have done some url rewriting, is it a possibility that that is causing an issue?

RewriteEngine on
RewriteBase /
DirectorySlash Off

# remove trailing slash
RewriteRule ^(.*)\/(\?.*)?$ $1$2 [R=301,L]

# Redirect non-www urls to www
RewriteCond %{HTTP_HOST} ^thecardb\.com [NC]
RewriteRule (.*) http://www.thecardb.com/$1 [R=301,L]

# Don't match real existing files so CSS, scripts, images aren't rewritten
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d

# Match the first two groups before / and send them to the query string
RewriteRule ^([A-Za-z0-9-]+)?$ car.php?model_make_id=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-._]+)?$ car.php?model_make_id=$1&model_name=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-._]+)/([0-9]+)?$ car.php?model_make_id=$1&model_name=$2&model_year=$3 [L]

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-._]+)/([0-9]+)/([A-Za-z0-9-._]+)?$ car.php?model_make_id=$1&model_name=$2&model_year=$3&model_trim=$4 [L]

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-._]+)/([0-9]+)/([A-Za-z0-9-._]+)/([0-9]+)?$ car.php?model_make_id=$1&model_name=$2&model_year=$3&model_trim=$4&model_id=$5 [L]

Im lost! Any help is appreciated.

Answer

Kevin B picture Kevin B · Jan 16, 2013

jQuery recently upgraded to version 1.9 which removed most if not all of the depreciated methods. $.browser was one of them. Fancybox relies on $.browser, so you can't use jQuery 1.9 and your version of fancybox without the migrate plugin installed. Either downgrade jQuery, upgrade fancybox, or include the migrate plugin.

More information here: http://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released/

You should also always specify a version number.

http://code.jquery.com/jquery-1.8.3.min.js