Itunes基于Webkit平台,由于安全策略,我们无法在JavaScript中使用跨站点XmlHttpRequest.但是,作为例外,我们可以使用特殊标头来实现.这是源代码,我在Safari中成功完成了它:
var url = 'http://mysite.net/canvas.php'; var mybody = ""; var http = new XMLHttpRequest(); http.open("POST", url, true); http.setRequestHeader("X-PINGOTHER", "pingpong"); http.setRequestHeader('Content-Type', 'application/xml'); http.setRequestHeader("Content-length", mybody.length); http.setRequestHeader("Connection", "close"); http.send(mybody); Arun
我将xml数据发送到我的服务器并在Safari浏览器中成功获得返回响应,但我无法在iTunes LP环境中执行此操作.那有什么问题呢?