getResponseHeader

Hi

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
:slight_smile:

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