ajax在跨域做轮询的时候,每次request请求头不是XMLHttpRequest,是什么原因?
针对同样的服务端做ajax轮询请求,同域情况下,是请求头是XMLHttpRequest,如下:
Request URL:http://42.159.152.47/wx/scan/OA?rand=100&username=yiqiuheng&from=OA&objectid=1&t=1411480040192
Request Headers
Provisional headers are shown
Accept:*/*
Referer:http://42.159.152.47/test
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36
X-DevTools-Emulate-Network-Conditions-Client-Id:32E60886-6F0B-47D8-BFF3-E596A5D9D475
X-Requested-With:XMLHttpRequest
但是在跨域情况下,同样的ajax请求,请求头不是XMLHttpRequest,即同步的,这个是不能理解的!!!
Request URL:http://42.159.152.47/wx/scan/OA?rand=729&username=mlsc&from=OA&objectid=1&t=1411480245969
Request Headers
Provisional headers are shown
Accept:*/*
Origin:http://localhost:8080
Referer:http://localhost:8080/Wry_wx/wx.jsp
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36
X-DevTools-Emulate-Network-Conditions-Client-Id:AE742D3D-EEE6-48BB-90EC-46521A503DF7
请大神详解~~~