0

Possible Duplicate:
Accessing HTTP Headers in Javascript?

How would this translate this PrototypeJS code into jQuery?

 etag = response.getHeader("Etag") || 0;
 lm = response.getHeader("Last-Modified") ||
      'Thu, 1 Jan 1970 00:00:00 GMT';
Community
  • 1
  • 1
Laine
  • 79
  • 1
  • 8
  • 3
    Depends on what is `response` is. What is it? You are likely looking for the `jqXHR` object: http://api.jquery.com/jQuery.ajax/#jqXHR. – Felix Kling Feb 03 '13 at 14:21
  • Its nginx: http://www.brentsowers.com/2011/06/http-long-polling-aka-comet-with-nginx.html – Laine Feb 03 '13 at 14:22
  • Looks like you want to access HTTP headers in JS, which I found using [this search](https://duckduckgo.com/?q=javascript+http+headers). – halfer Feb 03 '13 at 14:23
  • @Laine: I rather meant what object it is. Seems to be `Ajax.Response`: http://prototypejs.org/doc/latest/ajax/Ajax/Response/index.html. – Felix Kling Feb 03 '13 at 14:23
  • Ah first this has to be converted to jQuery also: var txt = response.responseText.stripScripts().stripTags(); – Laine Feb 03 '13 at 14:24
  • 2
    How about reading the jQuery's `$.ajax` documentation (http://api.jquery.com/jQuery.ajax/) and showing what you got so far? SO is not a free code translation service. – Felix Kling Feb 03 '13 at 14:24
  • OP, you are expected to do your own research first before asking here, including understanding your own question. Just fyi. – Mahn Feb 03 '13 at 14:29

0 Answers0