本文通过设置Access-Control-Allow-Origin来实现跨域. 例如:客户端的域名是client.0751.tv,而请求的域名是server.0751.tv. 如果直接使用ajax访问,会有以下错误: XMLHttpRequest cannot load http://server.0751.tv/server.php. No 'Access-Control-Allow-Origin' header is present on the requested resource.Ori…