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)
alert("Your browser does not support XMLHTTP.")
if (xmlhttp.readyState==4)
document.getElementById('T1').innerHTML="This file was last modified on: " + xmlhttp.getResponseHeader('Last-Modified')
alert("Problem retrieving data:" + xmlhttp.statusText)