Title: Remove jQuery Dependency
Last modified: September 14, 2023

---

# Remove jQuery Dependency

 *  Resolved [markparolisi](https://wordpress.org/support/users/markparolisi/)
 * (@markparolisi)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/)
 * In the frontend script, `ctct_frontend_forms` can you please refactor it to remove
   the dependency on jQuery?
 * 
   While the jQuery usage is widespread in that module, it’s not doing anything
   that you can’t easily do with plain JS. Seems like just HTML element selectors
   with some event listeners.
 * 
   Removal of this dependency will align the plugin with the rest of the community
   that is shedding this dead weight.
 * Thanks for considering this request.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/remove-jquery-dependency-7/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/remove-jquery-dependency-7/page/2/?output_format=md)

 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17050964)
 * Hi [@markparolisi](https://wordpress.org/support/users/markparolisi/)
 * Thank you for the feedback here. I have filed an enhancement issue regarding 
   this request for our developer team to look into and consider.
 * Right now I suspect they’d be more open to at least handling our javascript used
   on the frontend, while any that is used on the admin side with the form builder
   would be a longer term task to accomplish. That said, we also assume site owners
   try to control jQuery inclusion more on the frontend than at all on the backend,
   where performance is a bigger topic.
 * Thank you for the feedback.
 *  Thread Starter [markparolisi](https://wordpress.org/support/users/markparolisi/)
 * (@markparolisi)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17050973)
 * Thanks for your response.
   And yes I agree that the CMS scripts for the form builder,
   etc are fine. It’s only on the client-facing front-end where we want to see a
   performance improvement by removing the jQuery library.
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17050989)
 * Great to hear. Since this has been filed now for ourselves internally, going 
   to mark the support thread as resolved. Hopefully in a near future release, but
   we’ll see.
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17072925)
 * Just wanted to chime in quick and say that we’ve been actively working on this,
   after agreeing that it’d be for the best. The changes are currently going into
   internal review to help make sure we’re not breaking any functionality, and hopefully
   it’ll be ready for our next big release. However, I can’t say for certain when
   that would be. **Probably** version 2.4.0, but no promises.
 *  Thread Starter [markparolisi](https://wordpress.org/support/users/markparolisi/)
 * (@markparolisi)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17072985)
 * Much appreciated. Not sure where you are doing the development as I don’t see
   a public repo for this in your Github org, but I’d be happy to help test and 
   review.
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17077325)
 * Are you willing to test all the changes that we have thus far in the next version
   of the plugin?
 * Right now that list would have the jQuery changes as well as:
    - Individual address fields and available required fields match up to what’s
      included.
    - Updated Internal logging library.
    - Moved disclosure messaging to outside of the generated `<form>` tag.
    - Empty list information when creating a list in WordPress Dashboard.
 *  Thread Starter [markparolisi](https://wordpress.org/support/users/markparolisi/)
 * (@markparolisi)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17077360)
 * Sure, I’ll help where I can. Just let me know how to communicate changes if not
   via this support forum.
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17077587)
 * For now here will be fine.
 * Here’s the zip:
 * [https://www.dropbox.com/scl/fi/2xegu6j06svznjclamm8a/constant-contact-forms.zip?rlkey=5rxtk029djiejcv7u2nws5k1p&dl=0](https://www.dropbox.com/scl/fi/2xegu6j06svznjclamm8a/constant-contact-forms.zip?rlkey=5rxtk029djiejcv7u2nws5k1p&dl=0)
 *  Thread Starter [markparolisi](https://wordpress.org/support/users/markparolisi/)
 * (@markparolisi)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17078342)
 * All good so far. Been doing routine functional tests just submitting data via
   forms created with the plugin. Both to CC subscriber lists and general contact
   form information submitted to an email address.
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17078519)
 * One spot that we’re not consistently recreating internally, that maybe you could
   help confirm, would be the submit button not being re-enabled when trying to 
   submit with not all required fields being filled in.
 * Beyond that, great to hear that everything appears to be working so far.
 *  Thread Starter [markparolisi](https://wordpress.org/support/users/markparolisi/)
 * (@markparolisi)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17078531)
 * Now that you mention it, I can reproduce that bug. 
   I also notice an error in
   the console…An error has occurred. [ File: ./wp-content/plugins/constant-contact-
   forms/assets/js/ctct-plugin-frontend.min.js?ver=2.4.0 ] [ TypeError: Cannot read
   properties of null (reading ‘querySelector’)
 *     ```wp-block-code
                               e.cache.forms[r].honeypot = t.querySelector(".ctct_usage_field"),
       ```
   
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17078561)
 * Do you have any public links where we could check on that behavior? I’m not managing
   to create either issue with my own local install. Curious if we could see it 
   happening elsewhere and get some ideas.
 *  Thread Starter [markparolisi](https://wordpress.org/support/users/markparolisi/)
 * (@markparolisi)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17078563)
 * [https://www.theyonkersledger.com/newsletter/](https://www.theyonkersledger.com/newsletter/)
   
   Feel free to submit dummy email addresses to that live list. Just make them obvious
   so I can delete them later.
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/#post-17078584)
 * I have some leads but it’s going to need to wait till tomorrow before I can get
   them touched up and provide a fresh copy of the plugin.
 * Thanks for all the willingness to help thus far.
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/page/2/#post-17080214)
 * Give this one a try.
 * [https://www.dropbox.com/scl/fi/2xegu6j06svznjclamm8a/constant-contact-forms.zip?rlkey=5rxtk029djiejcv7u2nws5k1p&dl=0](https://www.dropbox.com/scl/fi/2xegu6j06svznjclamm8a/constant-contact-forms.zip?rlkey=5rxtk029djiejcv7u2nws5k1p&dl=0)
 * I’m decently confident that I missed providing some fully compiled minified assets
   and this should handle that going forward.
 * Visual code changes noticed in a diff check from my original copy to you and 
   this one include using `removeAttribute()` instead of `setAttribute()` and “false”
   for disabled state on buttons, as well as a missed change away from `jQuery.val()`
   to fetch honeypot contents.
 * Hopefully this fixes up both of the issues you were seeing.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/remove-jquery-dependency-7/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/remove-jquery-dependency-7/page/2/?output_format=md)

The topic ‘Remove jQuery Dependency’ is closed to new replies.

 * ![](https://ps.w.org/constant-contact-forms/assets/icon-256x256.png?rev=2951825)
 * [Constant Contact Forms](https://wordpress.org/plugins/constant-contact-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/constant-contact-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/constant-contact-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/constant-contact-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/constant-contact-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/constant-contact-forms/reviews/)

 * 22 replies
 * 2 participants
 * Last reply from: [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/remove-jquery-dependency-7/page/2/#post-17116175)
 * Status: resolved