Ocassional Error loading script - javascript

I have some sites that I've been creating and they work fine but sometimes the pages will load and look like this
It'll usually work fine again if I reload the page but the problem is annoying and occurs around 20% of the time.

i went to that url and got it the first time, but then was not able to reproduce it.
do you have load sharing with multiple servers?
watch the network tab in the inspector for anything and post back what you see.

Related

not seeing a specific resource on a web page

i have a strange problem with a web page!and i can't see it in none of my browsers while all of my coworkers see it and work with it all well!
however if i use a vpn i can see it with no problem!
so i assume it is not my browser problem since i can see it contents with vpn
the strange part for me is that i can see title and html content but when it wants to fetch CSS and JS resources it gives (failed) net::ERR_CONNECTION_RESET!
i tried ping and trace rt and both of them was successful!
(and as i said i can see title of page and it first page that is a small page)
so i am not blocked by anything.
i also changed my internal network to something else and still it wouldn't loads up!i insert an image of what page is load in first place.
i don't know if it is relevant or not but the website is written with GWT
if anymore information is needed i be more than to happy too providing it.
i used firefox, chrome,edge,ie and none of them shows page!
i insert an image to show what is loaded
html page is loaded:the html page that is loaded and page content
resources that give error:the resources that fail to load
PS: sorry if cleared addresses out, i didn't know if it is right or not with the company to include them so i cleared them out.

jquery error: Failed to load resource: net::ERR_TOO_MANY_REDIRECTS

I'm currently working on website which works fine when accessed via the web. However, when I forked the project and opened the html file saved on my computer, the javascript doesn't load, and the console gives the above error.
Now, the bizarre part is that this only happens sometimes. If refresh immediately, I usually get the error again. However, if I wait 10-20 minutes, change nothing, then refresh the browser, the error goes away. I'll keep working on the project for half an hour, and then the error will come back. I can't find any sort of pattern between my actions and the prevalence of this error.
I honestly have no clue what's going on, and any help would be appreciated.

Can't figure out why a page will not load for some users

I am at a loss and need any advice I can get on what to try next.
I have a site where users can edit their profiles. We have about 10K customers. Of those customers about 20 have this issue and I can't figure it out. When they go to the page it acts like it doesn't finish loading. One symptom is when you hover over links the pointer will not change to hand.
For me I can login with their account and try different machines and browsers and it works perfectly. I can use Chrome and change the speed and view type all still works. I have never actually reproduced the issue.
They can hit CTRL+F5, clear cache, try different browsers, different systems, nothing works for them. Today I worked with one person and removed everything from loading on that page except for exactly what was needed. No Google Analytics, no FB pixel, stripped all the JS, and nothing helped. He even tried at his local library and it still happened.
I am totally out of ideas. Anyone have any suggestions?
Thanks
The page likely isn't "acting" like it's not finishing loading, it probably is not finishing loading. Your sample size is probably large enough to cover users with outmoded browsers or restricted bandwidth. You need to get more info from your users: OS & version, Browser, Virus protection.
If you're relying on GA and other 3rd party libs acquired by CDN, one downed delivery network can stop the entire page.
I've seen this happen while on a vpn. Ask your users if they're on a VPN when this happens. Some of your assets (googlefont api for example) will not load over crappy VPN's.

How to debug when javascript doesn't load

I have 2 sites using the same theme. (http://www.kentishtowner.co.uk and http://here-is.com/kentishtowner-old/ )
They are WP multisite subsites, both using the exact same child theme (same template files exactly).
However, the former website is not loading javascript, causing the masonry layout and mobile menu to not work!
I assume this is something to do with when I mapped the domains, or changed the URL from something like here-is.com/kentishtowner-new to here-is.com/kentishtowner, before domain mapping...
As I am not a JS person, can someone give me some insight as to how I can go about debugging this?
I haven't slept a wink last night and it's now 11am - am getting an hour's shuteye, and would hugely appreciate any responses!
Thanks!
In Chrome's console you'll see
Resource interpreted as Script but transferred with MIME type
text/html:
"http://here-is.com/?dm=c078877dcf0e3101dc20cc337a8e4214&action=load&blogid=13&siteid=1&t=1522670393&back=http%3A%2F%2Fkentishtowner.co.uk%2F".
In fact, further digging shows that here-is.com is returning an empty response to that request.
The page is actually referring absolutely to a number of resources on here-is.com and that works fine when you access it via that domain, but has issues when you access via www.kentishtowner.co.uk. I don't know enough about your setup to say for sure how to resolve it but you probably need to configure the base URL of the project to tell it where it's being deployed, or if you can tell it to use relative links that would work too.
(In Chrome's developer tools you can hit ctrl+shift+F and type here-is.com to see the references)
Browsers have consoles where javascript errors are thrown. They will tell you what error was thrown, and where it was thrown from. Once you know that, you can google around to see if there is anything obvious to fix.
My guess, though, is that somewhere the site that isn't working is trying to use a script that was hosted on the working site. If that's the case, you just need to update the script paths.
--edit--
Fortunately for me (from what I hear), I have never used Wordpress. Unfortunately for you, I don't know how to tell you where the .js files would be located, or how they are organized at all.
I usually debug in Chrome, so this is how you can check to see if your page is able / unable to get an external script.
When you are focused on the page you're having a problem on, hit F12 to open up the dev tools in Chrome.
Click on the Network tab, and then hit F5 to refresh the page.
Click on the Type table header, and look for files that say text/javascript. Those will be the external script files your site is requesting.
Look at the Status column for each of those rows. If it doesn't say 200 OK., then your page isn't able to access the corresponding script.
From there, you would need to find where those scripts are supposed to be located. Once you know that, just find the scripts from the other site, and copy them into the correct location of the broken site.
Good luck!

Wordpress returning half a response

Running out of ideas that could be causing this issue so just thought I would throw it out there.
I am currently developing a site based on Wordpress which has some search functionality powered by a web service. The web service returns a load of details of various residential properties, including absolute image paths which I am requesting and caching on first request.
I embedded RoyalSlider into the page to display the images in a form of gallery. This works brilliantly locally, but the issue I am seeing is when I stick the site onto a staging server. My page just fails silently whilst loading, halfway through loading my RoyalSlider thumbnails. I have checked the raw response from the server and indeed it appears that the response just stops halfway through loading all of my RoyalSlider images. But its a 200 response, no 404's, no console errors, nothing.
Oh and I should mention that if I set a break on my loop which renders my markup, i.e limit it to say, 10 iterations, the problem does not persist and the entire page loads (albeit with only 10 of my images loaded).
Does anybody have any idea what would cause something like this to happen?
Thanks in advance
The main cause of this issue was a difference in PHP versions. This should have been one of the first things I checked, as I was seeing problems in one environment and not in another - I had just complacently assumed I was on 5.3.
The php version on my staging server (5.2) seems to have had some kind of issue with my caching layer - although what that was exactly is still unclear (leaning toward something to do with output buffering as suggested above). Updated the php version on staging though and that appears to have fixed my issue.
Thanks for the ideas Adam!

Categories