3 ms·
Well, found below code in https://maps.googleapis.com/maps/api/js https://maps.googleapis.com/maps/api/js function getScript(src) { document.write('<' +
by mooveprince 10y ago
Well, found below code in https://maps.googleapis.com/maps/api/js https://maps.googleapis.com/maps/api/js
function getScript(src) {
document.write('<' + 'script src="' + src + '"><' + '/script>');
}
- kinlan 10y agoYep, so we will likely be breaking our own maps on slow connections... (remember it is not really slow sites that we measure)... but the broader point is, if that script blocked rendering, which it would, then a user on a slow connection would likely not even see the content of the page, let alone the map. So the broader question is, for someone who wouldn't get the content normally is it better to break a smaller section of the site vs not see the site at all? If the user is on a fast connection then everything would still work. Although a quick search in that code, I can't see getScript actually being called.
- MatthewPhillips 10y agoThat you're only breaking a small section of a site is a false assumption. You really have no way of knowing that. You will be breaking the entire site in the case of a site that writes all of its content using JavaScript obtain from that resource. This is fairly common with jQuery fallback document.write scripts. document.write() calls are dependencies of the site, in many cases. Some times they are just worthless ad stuff, but you shouldn't make any assumptions here. Not breaking the web should be the priority.
- EdwardDiego 10y agoHehe, as a slightly jaded participant in the advertising industry, I note that Chrome only breaks technologies used for ad-serving that Google's stopped using. That said, I'm glad they are doing this, because finally we can wean our advertisers off their document.write obsession.
- deleted 10y ago[deleted]