Can I using cross-site XmlHttpRequest in Itunes LP environment?
        Posted  
        
            by jameulrich
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by jameulrich
        
        
        
        Published on 2010-04-05T09:49:47Z
        Indexed on 
            2010/04/05
            9:53 UTC
        
        
        Read the original article
        Hit count: 317
        
itunes
Itunes is based on Webkit platform and we can't use cross-site XmlHttpRequest in JavaScript because of security policy. But, as a exception, we can do that with a special header. Here is source code and I did it successfully in Safari: /////////////// var url = 'http://mysite.net/canvas.php';
var mybody = "Arun"; 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);
///////////////
I sent xml data to my server and get return response successfully in Safari browser but i can't do it in iTunes LP environment. So what is the problems?
© Stack Overflow or respective owner