Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > jQuery TypeError that makes no sense

jQuery TypeError that makes no sense
Thread Tools
Addicted to MacNN
Join Date: Aug 2006
Location: God's Country
Status: Offline
Reply With Quote
May 18, 2013, 10:34 PM
 
I've been tweaking Maclassic.com, trying to stylize all the form elements to look more like OS 9. It's been pretty easy so far, but I've run into problems with a jQuery plugin I'm using for styling select (drop-down list) fields.

MediaWiki and Vanilla use an identical skin that I developed. The JS files loaded are different for each though - they're using what's built in, so I'm wondering if that's the problem.

At any rate, this is my error:

Code:
TypeError: g.addClass(...).on is not a function http://maclassic.com/common/scripts/jquery.customSelect.min.js
This isn't happening on MediaWiki, as seen in this page: Revision history of "Main Page" - Maclassic

It is, however, happening in Vanilla, as seen here: Sign In - Maclassic Discussion

For those who don't want to register just to see the form, here's what it looks like:



I searched around a bit on the error but can't figure out for the life of me why it's breaking.

This, by the way, is the plugin I'm using for jQuery: https://github.com/adamcoulombe/jquery.customSelect

ETA: Ok so it looks like it was a jQuery version issue. I manually upgraded Vanilla to jQ 1.7.2 and it works. Oddly, though, I couldn't upgrade to 1.9 - that broke the forums.
     
Moderator
Join Date: Jun 2000
Location: inside 128, north of 90
Status: Offline
Reply With Quote
May 19, 2013, 01:17 PM
 
glad you solved it!

jquery versioning can be a problem across plugins.
     
Addicted to MacNN
Join Date: Aug 2006
Location: God's Country
Status: Offline
Reply With Quote
May 20, 2013, 09:57 AM
 
That's annoying but good to know.

You'd think they would at least ensure backwards compatibility. Vanilla officially only supports up to 1.7.2, even though jQuery is up to 2.0. WTF...
     
Mac Elite
Join Date: Dec 2003
Location: I'll let you know when I get there...
Status: Offline
Reply With Quote
May 20, 2013, 05:00 PM
 
.on is a fairly new (and highly useful) jQuery function which is why any plugin using it wont work with a jQuery version prior to 1.7

Most plugins detail what version(s) of jQuery they work with.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 02:55 AM.
All contents of these forums © 1995-2015 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2015, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2