相关疑难解决方法(0)

如何从AJAX响应中获取cookie?

$.ajax在同一个域上有一个请求,我想读取cookie.它不断返回null.

$.ajax({
    type: 'GET',
    url: myUrl,
    success: function(output, status, xhr) {
        alert(xhr.getResponseHeader("MyCookie"));
    },
    cache: false
});
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?我正在使用Chrome.

html ajax jquery google-chrome

40
推荐指数
2
解决办法
10万
查看次数

标签 统计

ajax ×1

google-chrome ×1

html ×1

jquery ×1