Closed kennypu closed 9 years ago
You should deregister the jQuery Wordpress is using and register the 'normal' one. Don't forget to NOT deregister when in admin. This will solve your problem.
@gideonheilbron A vast majority of WordPress users may:
I believe you're saying jQuery noConflict is the issue here, right?
Also - you can't deregister jQuery in the admin anymore.
@gideonheilbron that is not a good solution, as it may break any wordpress plugins that rely on jQuery Wordpress.
It is bad practice to refer to $ anyways as it can be used for other libraries, not only jquery. I've seen it mentioned from time and time again (eg. http://www.sitepoint.com/10-tips-better-jquery-plugins/ #4)
Ok guys,
I tried to fix the non AMD jQuery requirement in order to not break things in Wordpress. Could you have a try at this version please? -> https://raw.githubusercontent.com/guillaumepotier/Parsley.js/master/dist/parsley.js
just tested on fresh wordpress install, yup it works (bottom left is the form): http://imgur.com/rGq4ssf,bV97Oy0
In comparison, ver 2.0.2 parsley.min.js (downloaded from the site) gave an error as shown: http://imgur.com/rGq4ssf,bV97Oy0#1
Great, I just released it as 2.0.3. Thanks guys for your feedbacks, enjoy!
thanks!!
Thanks a lot!
On Jul 21, 2014, at 6:00 AM, Kentaro Rose notifications@github.com wrote:
thanks!!
— Reply to this email directly or view it on GitHub.
I am still having this issue with the latest version of WordPress, Bones theme, and the latest Parsley.js
How is that possible?
But this is the official Parsley.js repo.
Yep, you're right. I got confused. I'm using Parsley 2.0.6, built just a few days ago. Did something change that would break this?
I'm not familiar with wordpress, but did you include jQuery?
Btw, parsley require attributes still work, without calling
$('#myform').parsley();
But, data-parsley-equalto="#password" , for example, does not work. Plus, I get
undefined is not a function
if I try to call the above
jQuery is included in WordPress by default.
Can you provide a link?
I wish I could, but it's a private project. :hankey: Sorry, I know that doesn't help.
Thanks @marcandre. Changing the document ready function fixed my problem.
including parsley.min.js with a regular Wordpress install will cause an 'undefined is not a function', since the file is using $ to reference jQuery.