Recently, we discussed how sometimes people make mistakes with pixel shim GIFs that have bad URLs and create a 404 that doesn't seem to effect page look and feel -- but still does show up in the Web server logs. With that thinking in mind, as we have looked at various server environments, we started to see another hidden 404, this time occurring as the result of JavaScript code.
With JavaScript, many people try to prefetch or preload objects for a variety of purposes, from perceived page speed up to trying to insure proper rollover function. These JavaScript fetched objects very often are also referenced in the HTML or CSS as well, so, if the JS fails, you might not actually notice any particular functional break in most cases. Well, lo and behold, looking at all these logs from customers and what not, we start to notice the occasional 404 pattern of 404s that are coming from the JavaScript side. The interesting thing about them is that referrer is not going to show the JS file but the actual root HTML file. This might be particularly mysterious to someone if your JS files are external.
So anyway, yet another little polish point -- make sure if you are going to preload or do other fetching with JS that you get your URLs right.
Cheers,
Port80
P.S. Sorry to say, folks, link checkers aren't going to capture execution-oriented URL problems from JS: you going to have to spot it from bad functionality or looking at the logs! A perfectionist’s work ain’t never done, pardners.