Ajax stopped working suddenly on entire webstie - javascript

I have a WordPress website and for some reason, all the AJAX features stopped working. Auto plugin and WordPress update are turned off and I haven't made any changes. I even uploaded a backup of all theme files and still the same problem. There are no JS errors and responses are coming in as ok (no 500 errors). I have no ideas on where to even start looking. Any suggestion would be of help.

I figured it out. Somehow a <p>nbsp</p> got saved at the top of one of my php files. Not easy to find since it doesn't cause any errors.

Related

GET ERR_ABORTED 500 (Internal Server Error) in WordPress while loading JS resources

I am having some trouble with my WordPress website. Some JS files are not loading properly and generating HTTP error 500 in the browser (I can see it from browser inspection, tried all browsers). There is nothing strange in debug mode on the website nor traces in the website log file.
Malfunctions occur when creating a new post (the visual editor does not work, nor does the block editor), or in the theme customizer (preview does not work).
I have already tried the most common solutions (browser cache, regenerate .htaccess, change the version of PHP, etc.), but it seems to be something more sneaky.
Here's a screenshot.
I also tried doing a fresh and minimal install of WordPress in a subfolder, but there are the same issues, so I guess it is something more general. My hosting support was unable to help me though.
Has anyone had such an experience? Do you have any suggestions to guide me toward a solution?
Thank you in advance.

Tempalte File won't update in Browser

im trying to change some behavior of a webpage. The page is built using SMARTY so the file that won't update is a .tpl file. Containing mostly JavaScript. The whole thing is weird because on my local drive (IDE) the file is the way i want it to be, it is the correct version on the server when i check it with SFTP.
BUT if i open the page with a browser, even a newly installed one, the code inside that page is the old version.
Now i can't send any error because there obviously is none.
So im lookin at a problem i can't fix or even begin to untangle.
I tried following things:
Restarting apache2
Deleting the file and uploading the correct version (here i might add the site broke when i deleted it and tried to view it)
This has been bugging me for a long time so it seems time couldn't fix it either.
I hope somebody has any idea to why this is happening!
Thanks
Clear (delete all cache files) smarty cache!
More details about cache dir: https://www.smarty.net/docs/en/api.set.compile.dir.tpl

page doesn't load css and js files after refresh

I have the problem that my site does not load some css and js files when refreshing the site. When I first call the site everything is fine, its just after refreshing.
http://www.benty-fields.com/
Its a bit hard to debug, since on my local host everything works fine, its just a problem on the server. I am using the free tier on AWS, but I can't find any discussion about such a problem in connection with AWS, so I guess its my site. Has anybody have seen such a problem before and can give me some tips how to resolve it?
carl
EDIT:
I use chrome Version 45.0.2454.101 (64-bit) when I get the error, but I seem to get similar errors on firefox.
The error will modify the website, since the css files are not loaded, but you can also seem them if you go to
View > Developer > Javascript console... you should see something like that
GET http://www.benty-fields.com/static/css/popbox.css 500 (Internal Server Error)
(index):192 GET http://www.benty-fields.com/static/js/spin.min.js
(index):185 GET http://www.benty-fields.com/static/js/moments.min.js 500 (Internal Server Error)
(index):191 GET http://www.benty-fields.com/static/js/bootstrap-select.min.js
It seems that website is working fine for me, please have a look into attached image and let us know your thoughts,
This is not a real solution to the problem, since I guess there is a solution on AWS itself, but for me the problem was solved by moving to digital ocean...
cheers
carl
If you're running Cloudflare, remember to clear its cache and enable development mode. This is something that used to nail me and waste hours of time when I first started running my sites through Cloudflare. Hope this helps someone.

Javascript won't load over network using MAMP?

I'm using MAMP for a local website, I have www.mywebsite.dev set up and everything works fine.
But when I try to access by 192.168.0.198 - my comp's IP, it will load the website fine, images, css and all. But it fails to load the javascript. I've checked the paths and all look fine - why would it load everything but JS??
(I need to use the IP to test over the network)
Thanks!
Thanks guys for the help, I managed to get it working by clearing the cache in my CMS's navigation section. Turned out one of the elements were not loading in quick enough. Cheers!

Javascript only works with ip after page refresh, before refresh access using dns works

I'm struggling with a weird problem.
All my document.ready functionality is working when using the web page by dns.
When switching to IP the functionality breaks, but starts working after a page refresh.
Have anyone encountered this phenomenon before?
I know this is vague and apologize beforehand.
Thanks for any help!
Update:
Script has been verified to be loaded at the time when functionality doesn't work
Based on your vague question, the only POSSIBLE idea I can come up with is that some Javascript you have is now being referenced by IP address http://127.0.0.1/scripts and the scripts directory is only available via the DNS named http://hostname/scripts.

Categories

Resources