SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Header problem
-
Aug 1, 2008, 03:00 #1
- Join Date
- May 2007
- Posts
- 242
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Header problem
Hello. I request header info of a file that is on my server via ajax call.
xmlhttp = new XMLHttpRequest();
xmlhttp.open("HEAD","http://www.example.com/ht.hmtl",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
alert(xmlhttp.getAllResponseHeaders())
}
}
xmlhttp.send(null)
Thanks in advance.
-
Aug 1, 2008, 03:40 #2
- Join Date
- Oct 2004
- Location
- Birtley, UK
- Posts
- 2,439
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ajax simply requests data like a browser. It can also cache the response.
try
Code javascript:xmlhttp = new XMLHttpRequest(); var url = "http://www.example.com/ht.hmtl" + new Date().getTime(); xmlhttp.open("HEAD",url,true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { alert(xmlhttp.getAllResponseHeaders()) } } xmlhttp.send(null)
-
Aug 1, 2008, 03:46 #3
- Join Date
- May 2007
- Posts
- 242
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Oh God. Didnt know that. Thank you very much. It helped.
Bookmarks