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"
.
If I go to the page where the source is trying to pull the jQuery file, you'll see the error:.7.1.min.js?ver=3.4.2
Screenshot of the error:
And this screenshot is the reference in the page source:
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?
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"
.
If I go to the page where the source is trying to pull the jQuery file, you'll see the error:https://code.jquery./jquery-1.7.1.min.js?ver=3.4.2
Screenshot of the error:
And this screenshot is the reference in the page source:
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?
Share Improve this question edited Nov 5, 2012 at 12:29 Nick 8,5403 gold badges39 silver badges33 bronze badges asked Nov 5, 2012 at 9:43 cmykrgbbcmykrgbb 231 silver badge5 bronze badges 4-
The jQuery content delivery network doesn't support https. You'd need to load jQuery from the Google or Microsoft CDNs instead, which do support https. How you do that depends on which script is requesting the file from
code.jquery.
. Is it being requested by one of your theme files, or one of your plugins? (You could do a full text search of your wp-content folder for 'code.jquery.' to find out.) – Nick Commented Nov 5, 2012 at 10:35 - Hey thanks for pointing me in the right direction so quickly! I've just installed a Wordpress plugin that lets me choose the CDN. wordpress/extend/plugins/wp-jquery-cdn/installation But still not working, and if I look at the source code, it's still requesting code.jquery instead of google, so I guess it must be the plugin, right? Your help on this is much appreciated! – cmykrgbb Commented Nov 5, 2012 at 10:46
- I finally changed the URL to Google's CDN in the functions.php file. Now it's requesting the correct CDN and working flawlessly. Thanks for your help mate! – cmykrgbb Commented Nov 5, 2012 at 11:14
-
I've posted my ment as an answer showing how you can include jQuery over HTTPS. It's particularly important to use the
wp_enqueue_script
function so that you don't end up including jQuery twice or more if other files or plugins use it. – Nick Commented Nov 5, 2012 at 12:36
1 Answer
Reset to default 4The code.jquery.
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./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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745551105a4632581.html
评论列表(0条)