XMLHttpRequest可以从http:// mydomain.com/向http:// mydomain.com:81/发送请求吗?
根据带有凭据的请求,Firefox只会发送凭据以及跨域帖子
invocation.withCredentials = "true";
设置...但似乎jQuery的Ajax API没有为此提供任何机制.
有没有我错过的东西?还有其他方法可以做到吗?
我想知道,在IE和Firefox中你可以设置浏览器,允许跨域调用.
我在chrome中找不到任何选项(实际上,通常没有太多的选项......)
有什么关于:配置像东西?
亲切的问候
--Andy
我正在尝试使用jQuery在特定端口上运行AJAX查询:
$(document).ready(function() {
$.ajax({
url: "http://test_serve:666/test.php",
type: "GET",
data: ({value_test: 'true'}),
dataType: "html"
});
})
Run Code Online (Sandbox Code Playgroud)
这不起作用:没有进行AJAX调用,我在Firebug中没有任何异常.如果我没有指定端口,它确实有效.有谁知道为什么?
$(document).ready(function(){$ .ajax({url:" http://gdata.youtube.com/feeds/api/users/zdf/playlists?v=2 ",输入:"GET", success:function(msg){console.log(msg);}});});
我收到此错误"XMLHttpRequest无法加载http://gdata.youtube.com/feeds/api/users/zdf/playlists?v=2 "
如何进行跨域ajax调用以从api获取xml?