jquery getResponseHeader always returns 'undefined'?

后端 未结 3 699
失恋的感觉
失恋的感觉 2021-01-11 09:27

I have a a form that I am submitting via ajax. I am using the jquery form plugin. What I am trying to do is get the \'Location\' header which is returned from my server.

3条回答
  •  心在旅途
    2021-01-11 10:02

    An XMLHttpRequest will transparently follow a redirect, so the final request won't have the header, it's already followed that redirect and you're seeing the response headers from that request (not the initial request which had the Location header).

提交回复
热议问题