经典的“Origin ... is not allowed by Access-Control-Allow-Origin”问题。两台机器为同一个网站提供内容。当机器 A$('#main').load('link_to_resource_on_B')通过 jquery执行 a 时,机器 B 使用 mod_python 提供内容,并添加Access-Control-Allow-Origin: *标题。但由于某种原因,这仍然不起作用。我在 Chrome、Safari 和 Internet Explorer 上对此进行了测试。我通过命令行测试以检查响应标头,它似乎Access-Control-Allow-Origin: *在来自 B 的标头中成功。见下文。我可能会错过什么?
$ telnet localhost 80
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /tests/python/test/env HTTP/1.1
host: 10.0.1.10
HTTP/1.1 200 OK
Date: Mon, 27 Feb 2012 02:05:33 GMT
Server: Apache/2.2.20 (Ubuntu)
Access-Control-Allow-Origin: *
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/html
Run Code Online (Sandbox Code Playgroud)