With a HEAD request, a server will return the headers of a resource (not the resource itself). This means you can find out the Content-Type or Last-Modified of a document, without downloading it itself.
<script type="text/javascript">
if (window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest()
else if (window.ActiveXObject)
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
xmlhttp.onreadystatechange=state_Change
xmlhttp.open("GET",url,true)