http request with mobile Safari

Thommsn

New member
Aug 12, 2009
1
0
0
Visit site
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.
 

Latest posts

Trending Posts

Members online

Forum statistics

Threads
259,997
Messages
1,765,282
Members
441,219
Latest member
MadisonOlsen