I finally went from my test site to my new site today and everything worked out well except the AJAX doesn’t seem to work:
1 – I can’t type in the search box and have it automatically display results
2 – The “Load more” buttons don’t work on my homepage
3 – The slide out “More articles” box doesn’t work
Here’s my site: http://www.OralAnswers.com
Here’s my test site where AJAX is working… Both are on same server: http://www.teabear.com/sandbox
Here’s what I’ve tried on my new site:
1 – Disabled and re-enabled the theme
2 – Deleted the theme folder via FTP and re-uploaded it
3 – Deactivated nearly all of my plugins (caching, security, etc.)
Nothing seems to work… Please help!
-
This topic was modified 11 years by
tcdraper.
I still can’t figure out this issue. The slide-out article does work, but the “Load More” buttons and the “live search” which use AJAX are not working…
I filed a support issue with my webhost and they looked into it and said that they are unable to pinpoint the problem and that this is not an issue with the server.
Please help – Thanks!!
XMLHttpRequest cannot load https://www.oralanswers.com/wp-admin/admin-ajax.php. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://www.oralanswers.com’ is therefore not allowed access.
You got to call admin-ajax.php it from the same url as of your site. Either use http:// or https:// for both.
Getting?
Thanks Shashank.
I just noticed that when I go to https://www.OralAnswers.com then AJAX works, but it doesnt work at the non-secure site.
I do have the WordPress option “Force SSL Admin” enabled in my wp-config file.
Do you know how to fix this? How do I add the Access Control Allow Origin header? Thanks!
Okay, now try this.
Copy the admin-ajax.php to my theme directory and removed the unneeded stuff. Then use it for your ajax calls instead of the wp-admin one.
<?php get_template_directory_uri(); ?>/admin-ajax.php
You can check yourself which files call the admin-ajax.php and modify them.
Ask tagDiv for the files that call the admin-ajax.php
or
You need to change the variables in the get_admin_url() function to force the AJAX requestion to use http instead of https. Change it to look like:
get_admin_url(null,'','http');
I hope this helps a lot of people!
Thanks. I like the second option better.
Can I get a confirmation from tagdiv that this won’t mess anything up with the theme?
Also, can we get this fixed in the next version? Having admin over SSL is a secure option that most people should be using especially if they use public wifi.
Thanks!
Hi,
Thanks Shashank Shekhar!
@tcdraper
Sorry for the delay!
I have checked your site and seems like all issues you have reported are fixed now:
*live search: http://screencast.com/t/NOAxNEMX
*load more: http://screencast.com/t/UH9FMI6Cy
*more article box: http://screencast.com/t/teiSfeJUVvw
If this is still happening I recommend first to check if this dose not come from a plugin or plugins settings. If you use CDN for example you would have to purge files as an old version of some file may be delivered by this CDN plugins and this may cause many issues, so if you use any please try to empty all cache server and browser also and make sure this dose not happen because of an plugin.
If you encounter this issues again and you go over all this steps and dose not work please send an e-mail at contact@tagdiv.com and give us wp-access so we can check this, send a link to this topic or specify in detail the issues you encounter.
Thanks
Thanks, Lucian. I had someone else from my webhost look at it since it was odd that it was working on my test site but not the main site.
Turns out that my URL was OralAnswers.com on WordPress but it was looking for oralanswers.com.
Since it’s case sensitive, changing everything to all lowercase solved the issue.
Thanks for your help!
I feel like I’ve got everything implemented now, just have to work on increase my pagespeed score from 60 on mobile :-/