In the Chrome and UC browsers of the iphone, when JSONP is used across domains, the request's accept will be: */*;IMAGE/WEBP.
When there is no special handling of content-type on the backend, the IMAGE/WEBP will be returned directly, and chrome and UC will not be able to perform the JS returned by JSONP.
Solution:
1, abandon the Jsonp form cross-domain, instead of setting access-control-allow-origin
Http://www.alloyteam.com/2012/11/html5-cors/?wpmp_switcher=mobile
2. When a cookie is required to cross a domain,
Back-end settings:
Access-control-allow-credentials:true,
Ajax settings:
Xhrfields: {
Withcredentials:true
}
It is important to note that Access-control-allow-origin cannot be set to * at this time
Otherwise the error is as follows:
XMLHttpRequest Cannot load Http://api.d.driver.edaijia.cn/workbench/userInfo?appkey=51000031&ver=3&met ... 11:16&ssid=u8srbnhpv2cogetnvaudrb3974&sig=61be8551eb4f8a8e3007ef748602df5e. A Wildcard ' * ' cannot be used in the ' Access-control-allow-origin ' header when the credentials flag is true. Origin ' http://h5.d.edaijia.cn ' is therefore not allowed access.
IPhone Chrome&iphone UC Browser Jsonp accept Bug & h5 access-control-allow-origin cross-domain