After being asked to investigate a slow page load I noticed this in the HTML:
<img src="/ajax?action=askedAboutCookies" style="display:none" width="0" height="0" alt="" />
When the page loads, it obviously makes the request, but it doesn’t return and simply waits until it times out.
The URL /ajax?action=askedAboutCookies actually points to a servlet that doesn’t return an image, it (when it works) returns JSON (a very basic object, returning a boolean value).
Why would anyone do this? All our pages use jQuery, so I would have thought it was easiest to use their Ajax convenience methods for any calls like that?
They are just pinging the server to track the user. There is no worry if XMLHttpRequest object is enabled or if JavaScript is enabled. Only time this type of call fails is when images are disabled.