1

I'm having an issue with some missing http headers in a Ajax response. The ajax-page (.NET) adds som additional info to the http header by using Me.Response.AddHeader("ResponseCode", mResponseCode). If I access the ajax-page directly and use httpAnalyser to check the headers, I can see that the headers are added correctly. But when I call the Ajax page through jQuery, the headers are missing.

I'm puzzled. Anyone out there that can help me?

Best regards, Steffen

1 Answer 1

1

In your complete or success method the first parameter is an XMLHttpRequest object that contains this information. You can retrieve any response header like this:

xmlHttpRequest.getResponseHeader('header-name');
Sign up to request clarification or add additional context in comments.

3 Comments

Yes - I know. But when I try that I get an empty string, because the header that I'm accessing is not present in the http header when I call the page through Ajax. It is however present if I access the Ajax page directly.
You can also check the headers for AJAX calls with Firefox's Firebug add-in (using the Net tab). So you know if the header is really missing and if the problem is on the server or on the client.
The headers was not present, but it turned out that is was a problem elsewhere which cause the problem. But thanks for trying to help me out :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.