I had an idea to do this one time but never got around to it... My idea was for with a website I owned but it should work just aswell for any other site, and it doesn't require the client having to download an image file, but rather a much smaller javascript file.
Since you can embed .js files in your page across webservers, the idea was to use something like this:
<script src="http://server1.com/jsfile.js"></script>
The jsfile.js would contain variable declarations, ex:
var VariableX = "some variable input";
So, you can use code like the following in order to get what you want with JavaScript only...
<script src="http://server1.com/jsfile.js"></script>
<script>
if(VariableX) { document.write("The webserver is online!"); }
else { document.write("The webserver is offline."); }
</script>