Gravity Forms not loading under https, jQuery is not defined

I am using the Gravity Forms plugin on my WordPress site. I am serving the page over HTTPS and this is breaking the form.

It looks like the issue is how the site is trying to load jQuery. There are 23 JavaScript errors on the page, which seem to be due to a failed jQuery load "Uncaught ReferenceError: jQuery is not defined".

Read More

If I go to the page where the source is trying to pull the jQuery file, you’ll see the error:https://code.jquery.com/jquery-1.7.1.min.js?ver=3.4.2

Screenshot of the error:

enter image description here

And this screenshot is the reference in the page source:

enter image description here

So I have been told I’d want to look into that – that’s where the ultimate issue is, but I don’t really know what to do next.

Is it failing because of Gravity Forms, the HTTPS plugin from WordPress, or my SSL certificate?

Related posts

Leave a Reply

1 comment

  1. The code.jquery.com domain doesn’t support https. You need to load jQuery either from your own domain or from the Google or Microsoft CDNs instead.

    To load jQuery from your own domain over https, simply do this:

    <?php wp_enqueue_script('jquery'); ?>

    To load it from Google’s CDN over https, do this:

    <?php 
    function jquery_cdn() {
       wp_deregister_script('jquery');
       wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js', false, null);
       wp_enqueue_script('jquery');
    }
    
    add_action('wp_enqueue_scripts', 'jquery_cdn');
    

    Omitting the ‘https’ in the above sample is deliberate; it ensures that jQuery will be loaded over the same protocol as your site, be it HTTP or HTTPS.