php包括来自localhost的其他端口

时间:2014-10-15 13:56:50

标签: cross-domain

我正在为WIndows构建一个php桌面管理站点,因为我在户外很多,但我不能成功地包含传输-qt web界面。我尝试更改.htaccess $.ajax GET$.ajax PUT但我仍然收到此错误:

XMLHttpRequest cannot load http:// localhost:8123/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http:// localhost:8010' is therefore not allowed access.

如何在不使用iframe的情况下包含它?

传输端口为8123,网络服务器端口为8010

1 个答案:

答案 0 :(得分:0)

我认为localhost:port中的服务器必须发送允许跨域的响应头。

Access-Control-Allow-Origin:*

https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS