3
votes

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.

2
Are you including jQuery from the CDN? If you are, what url are you using? If you are and are not specifying a version, your jQuery updated to a newer version that doesn't include the $.browser method that your version of fancybox appears to be using. - Kevin B
I am including it from this url code.jquery.com/jquery-latest.js ?? - AJFMEDIA
impressivewebs.com/linking-to-jquery - Always use a specific version. jquery-latest.js isn't minified nor cached. - Andreas

2 Answers

12
votes

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

0
votes

You need to change your code:

Find:

$.browser.msie

Replace this with:

navigator.userAgent.match(/msie/i)