View Full Version : getResponseHeader

10-24-2010, 12:05 PM

I'm a newbie looking for some help, I've been scratching my head for a day or two.

What I need to get do is check the last modified tag of a file and see if it has been updated and if so then perform a function, if not do nothing.

I have managed to get the last modified date quite easily but its the rest I am struggling with. I have pasted what i have already below. I have looked at the etag as well but that stumped me too!

This is to update a message on a website which is stored in message.txt. I want to use JS as eventually i want to incorporate it in an air app

Thanks in advance for any help

function sHead(U, P) {
var X = !window.XMLHttpRequest ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest;
X.open("HEAD", "message.txt", false);
return P ? X.getResponseHeader(P) : X.getAllResponseHeaders();

var myDateMod =sHead("Last-Modified");