In the midst of a long web development routine, I occasionally encounter unusual errors. Here, it seems, everything is fine - and so it works, and this works. And in the third - does not work, although at first glance it should. I simply adore the process of finding the causes of such errors and would like to share some of these stories. Answers (which actually was not so) I will publish in a couple of days.
1. Mysterious slider
There are two sites on support (not developed by me), online shopping. The code is completely identical - both the frontend and the backend (one copied from the other after completion of the development). On both sites, on the main one, among other things, the usual javascript slider with goods.
Once the customer turned and said that one of the sliders was “broken”. Stopped spinning (automatically and when you press the buttons). He cannot say exactly when it broke, but the code has not been modified for a long time. And, most importantly, another slider on another site works like a clock.
As I have already said, the site code is identical, the only differences are the hosting provider, the domain, the name, and also a different range of products (only 20% intersect).
')
What could be the reason for the breakdown?
Important tip: both sites are engaged in perfumery.
2. Mysterious basket
The same two sites. The customer complains that on one of the sites the goods are sometimes not added to the basket (using the button from the product page). But - only on one of them.
Surface testing has shown that the problem is being reproduced, and in fact, only on one of the sites. There is a problem only if you open the catalog and try to open the product pages from there as soon as possible and click on the “Add to cart” button.
There are no JS errors in the console, the only thing is that it cannot find a file of some image icons from the site template:
GET http:// _c /img/1.gif 404 (Not Found)
But the error occurs on both sites and the domain is always correct (your own). Yes, and what it may be relevant?
3. Mysterious Google Map
The support got someone else's custom code with a Google map on which the points of the found cities were to be shown. The meaning is simple - according to the textual name of the city, its coordinates are searched for and a dot is put on them.
We enter London - we get a point in London, we enter Paris - at first glance, everything looks right. But no other city works correctly - the points are in the middle of a completely different country. USA, Russia, Asian countries - it's not there.
At first I thought that maybe it still finds small cities-namesakes at the indicated coordinates, but no, I looked around the map - and there are no close ones. And some points are generally indicated somewhere in the sea.
Looked at the code, eliminated the possibility of hardcode coordinates of cities. No matter how much testing, it seems that nothing works, but London finds something stable!
I am sure that many also have a couple of such amusing stories. Please feel free to add them in the comments to the post.
Answers:
Task 1Samouvazhektra
about a perfume slider, I suspect that any French name with an apostrophe could cause a problem
andyudol
In which instead of an apostrophe a single quote is printed.
Exactly!
Task 2It turns out that an unidentified picture can still affect. On one of the hosting sites it was configured by default, so that a standard 404 page would be issued, on the other - a spreading one, with counters and pictures. The handler was connected to the recycle button on document.ready, so on one of the sites he did not always have time to connect - he waited until the page was fully loaded.
I decided to simply add a transparent single-pixel image with the desired name.
Task 3andrew72ru
The latitude and longitude are confused on the map.
Bratsen
... rather, something with longitude. ...
Yes, the problem was with longitude - an error was made in the variable for it, so an empty value (zero) was always transferred.