I have started using omega 4, and it is the best theme ever. But i am having an issue in my jQuery.
I don't know if its omega issue or jquery problem, but i have added jquery.labelify.js in many of my sites and it works like a charm, but for some reason it is giving me an error when i use it with omega 4. And yes i have checked it it is being added in page and before sript.js file.
method of adding file on omega.info file: scripts[] = js/jquery.labelify.js
error : Uncaught TypeError: Property '$' of object [object Object] is not a function (jquery.labelify.js?n1p2j8:41)
Source of jquery.labelify.js : http://www.kryogenix.org/code/browser/labelify/jquery.labelify.js
Help Required
Comments
Comment #1
fubhy CreditAttribution: fubhy commentedTry wrapping the labelify code in this:
Comment #2
Mujtaba Ahmad CreditAttribution: Mujtaba Ahmad commentedStill same error. Everything else is working perfect.
Comment #3
Mujtaba Ahmad CreditAttribution: Mujtaba Ahmad commentedComment #4
fubhy CreditAttribution: fubhy commentedI need more information to be able to help you. Are you sure that jquery.js is loaded before that library? This is a bug in your JS somewhere, not Omega, as apparently $ is not pointing to jQuery or jquery is missing at the time line 41 is executed. So please make sure that the JS that is executing the script to attach the labelify behavior is running after jquery is loaded.
I really need more information if you want me to help you with this problem. E.g. paste your DOM head to http://privatepaste.com/. In general it's much easier if you debug your JS with a proper IDE, e.g. PHPStorm. That way you can set breakpoints and properly figure out what exactly is causing the problem.
It seems like this line in labelify.js is causing the issue:
Are you sure that whatever you are using $(foo).labelify() on is actually a proper set of DOM elemetns?
Please paste the code you are using to apply labelify (the Drupal behavior in which you attach the functionality).
Comment #5
steinmb CreditAttribution: steinmb as a volunteer commentedComment #6
steinmb CreditAttribution: steinmb as a volunteer commented