header设置跨域问题

  1. header("Access-Control-Allow-Origin: http://a.com"); // 容许a.com发起的跨域请求  
  2. //若是须要设置容许全部域名发起的跨域请求,可使用通配符 *  
  3. header("Access-Control-Allow-Origin: *"); // 容许任意域名发起的跨域请求  
  4. header('Access-Control-Allow-Headers: X-Requested-With,X_Requested_With');  
相关文章
相关标签/搜索