Tagged: x
-
AuthorPosts
-
January 12, 2017 at 3:01 am #1326910
Hi
I would like to disable the current ajax.googleapis
and
fetch from one of these servers instead:<script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js”></script>
<script src=”http://code.jquery.com/jquery-2.1.4.min.js”></script>
<script src=”http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js”></script>
<script src=”https://cdn.jsdelivr.net/jquery/2.1.4/jquery.min.js”></script>The reason is because the website is getting blocked in china.
my test site:
http://wordpress-30009-64912-195478.cloudwaysapps.com/Attachments:
You must be logged in to view attached files.January 12, 2017 at 3:36 am #1326957Hi there,
Thanks for writing in.
Hmm, that could break your site since Google hosted jQuery doesn’t have noConflict() initialization compared to WordPress’ jQuery,
But please try adding this code to your child theme’s functions.php
function external_jquery() { if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', '//cdn.jsdelivr.net/jquery/2.1.4/jquery.min.j', false, '2.1.4'); wp_enqueue_script('jquery'); wp_add_inline_script( 'jquery-migrate', 'jQuery.noConflict();' ); } } add_action('init', 'external_jquery', -99 );
Hope this helps.
January 13, 2017 at 3:22 am #1328516Hi there! thanks. Good news is that it removes the ajaxgoogleapis.
Bad news is that it breaks the site.
‘Simple cornerstone slider
column transitions
my custom jquery
etc…January 13, 2017 at 3:23 am #1328518I have now removed the php from my functions
January 13, 2017 at 8:54 am #1328792Hello There,
From the code above, please look for this line:
wp_register_script('jquery', '//cdn.jsdelivr.net/jquery/2.1.4/jquery.min.j', false, '2.1.4');
Update to this:
wp_register_script('jquery', '//cdn.jsdelivr.net/jquery/2.1.4/jquery.min.js', false, '2.1.4');
We have a typo error on the code. URL is missing letter s at the endHope this helps.
January 14, 2017 at 3:52 am #1329736hmm no that did not work.
This time around it managed to register:
cdn.jsdelivr.net/jquery/2.1.4/jquery.min.jsbut the ajax.googleapis is still there
and it breaks the site
Simple cornerstone slider
column transitions
my custom jquery
etc…I have now removed the php from my functions
January 14, 2017 at 1:09 pm #1330076Hi there,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks!
January 16, 2017 at 12:59 am #1331564This reply has been marked as private.January 16, 2017 at 1:01 am #1331565This reply has been marked as private.January 16, 2017 at 2:09 am #1331632Hello There,
Thanks for updating in! Using a test page, I no longer see the ajax.googleapi error or even find it in the view source of the page.
http://prntscr.com/dw7ldu
http://prntscr.com/dw7m4zThis could just be a caching issue. Since you have installed a caching plugin W3 Total Cache, please clear your plugin cache before testing your site. This can cause the changes to not take place on the front end. It will eventually show up when the cache regenerates, but it’s not ideal if you’re looking to see your changes immediately. Caching plugins are best to turn on only when you’ve finished building the site.
Please let us know how it goes.
January 16, 2017 at 2:48 am #1331667LOL, of course it won’t show up if you only create a blank page.
try again now:
http://wordpress-30009-64912-202970.cloudwaysapps.com/x-cs-test/January 16, 2017 at 3:10 am #1331702Hello There,
I did check again and the issue is not there when I view the page in frontend. I can’t check in Cornerstone because you’re currently editing the page.
January 16, 2017 at 3:55 am #1331759you need to right click the inspector in chrome
Go ahead and take over the page its yours!
https://developers.google.com/web/tools/chrome-devtools/
Attachments:
You must be logged in to view attached files.January 16, 2017 at 8:40 pm #1332969Hello There,
When I check your site again, I cannot see above script on your child theme functions.php file. Did you remove it?
January 16, 2017 at 8:47 pm #1332971I you read above you can see that i removed it.
-
AuthorPosts