我无意中写了一个跨域
AJAX调用
NextBus(使用jQuery):
$.ajax({ url: 'http://webservices.nextbus.com/service/publicXMLFeed?command=predictions&a=sf-muni&r=1&s=6294',dataType: 'xml',success: function(data) { do_stuff(); } });@H_301_4@事实是,它适用于所有浏览器,尽管来自不同的域.鉴于单一来源政策,为什么这实际上有效? @H_301_4@页面在这里:http://sftransitfirst.org/F/,从下拉菜单中选择一个停止触发ajax. @H_301_4@正如预期的那样,对Google Maps API Web Services进行类似的调用会因熟悉的Origin而失败… Access-Control-Allow-Origin不允许这样做(并且它不支持jsonp).