P
P
Pavel Bezrukov2013-12-17 02:29:50
JavaScript
Pavel Bezrukov, 2013-12-17 02:29:50

Why does the onerror event often, ~500 per day (lightly loaded project 300-350 unique/day), get errors?

Good afternoon.
The onerror event often, ~500 per day (lightly loaded project 300-350 unique / day), errors like the following are thrown:

[msg] => Script error.
            [url] => https://maps.gstatic.com/cat_js/intl/ru_ru/mapfiles/api-3/15/5/%7Bmain,places%7D.js
            [ln] => 0

Either an empty string or scripts from google (maps, adsense) or from vk can come in the url field.
I started googling and came across similar to my case [ similar question on stackoverflow ].
I didn’t understand everything, due to my shallow knowledge of English, but it seems that the server owner of the scripts should give us the Access-Control-Allow-Origin header, which allows our host to read files - they give *.
Also, the crossorigin attribute appeared in html5, which says that we are downloading a remote file - with the addition of it, maps stopped loading on my mobile browsers!
BUT if the opera browser without crossorigin freezes at the 90% stage and continues to load without drawing maps (+vk widget). With the addition of the attribute, it quickly loads up to 100%, still not displaying external content - cattle.
I have nginx as a server, I admit that I could have configured it incorrectly ... or I don’t quite understand what could be the matter at all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sundukov, 2013-12-17
@alekciy

This problem has nothing to do with the server. A purely client-side question and security settings in JS. But it is stated so clumsily that even the specific essence of the problem cannot be singled out. I encourage you to think about it and reformulate it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question