- header("Access-Control-Allow-Origin: http://a.com"); // 允許a.com發起的跨域請求
- //如果需要設置允許所有域名發起的跨域請求,可以使用通配符 *
- header("Access-Control-Allow-Origin: *"); // 允許任意域名發起的跨域請求
- header('Access-Control-Allow-Headers: X-Requested-With,X_Requested_With');
以上並沒有測試,敬請原諒!