1. Thommsn's Avatar
    Hi,

    I am using the following javascript code:

    Code:
    var data = 'anyData';  
    var req = new XMLHttpRequest(); 
    req.open("POST", url, true);  
    req.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");  
    req.onreadystatechange = function(){  
        if (req.readyState == 4 && req.status == 200) {  
            console.log("success")  
        }  
    }  
    req.send(data);
    (url: localhost)

    When i open my website with the Safari everything is working (the data("anyData") is send to my web-server). I am testing this using the Axis TCP Monitor.
    But if i open the same site with the iPhone Simulator or a "real" iPhone the data gets lost.

    Are were any difference between Safari and mobile Safari?
    or is my Javascript code wrong? or is a httprequest like this not allowed with the iPhone?

    Any ideas will be very welcome.(i tried different frameworks to do the httprequest and nearly every existing sample)

    Thanks a lot.
    08-12-2009 05:06 AM
LINK TO POST COPIED TO CLIPBOARD