简体   繁体   中英

JQuery/ajax : Problem with jsonp call

I am trying to make a cross-site request, on a site that needs authentication. The authentication works with a cookie.

For some reason, when I am doing this call :

$.getJSON(url + '?', function(data){
    alert(data);
});

I don't see the Cookie sent in the HTTP headers. While when I just copy paste url in my address bar, the call is successful, and Cookie is set properly...

I tried to replace the $.getJSON by a $.ajax , and set manually the request headers. It resulted in the request not even visible in firebug (while I know it has been sent and answered to by using another tool)!!!

I am using firefox 3.6, jquery 1.4

Any idea on what's going on ?

这是同一来源策略的一部分,对其他域的 JSONP请求将不会发送任何cookie。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM