我想要的路徑名稱後,我請求一個URL我設置。我可以從URL給我的路徑在jQuery中給?
讓的說,我把http://www.abc.com
那麼服務器會自動返回我http://www.abc.com/sessionId/folder/default.aspx
,我需要得到jQuery的返回URL。
無論如何要做到這一點?
我試着ajax get/post來獲取響應頭的位置,它總是得到空值。
是一個參考代碼-i顯示在下面
$.ajax({
type: 'POST',
url: '/echo/html',
data: {},
dataType: "json",
success: function(res,status,XHR) {
//var location = XHR..getResponseHeader('Location');
alert(XHR.getResponseHeader('Content-Type'));
alert(XHR.getResponseHeader('Location'));
},
error: function(jqXHR) { }
});
先生,我不知道,但你應該得票。 +1爲您先生 – thecodeparadox