I'm developing an iPhone web app with dashcode. My app runs fine when I browse it with the iphone simulator. When I deploy it to a web-server, I never get a response from XMLHttpRequests. Here's the code I use:
function get(feedURL, handler) {
var onloadHandler = function() { handler(xmlRequest); };
var xmlRequest = new XMLHttpRequest();
xmlRequest.onload = onloadHandler;
xmlRequest.open("GET", feedURL);
var credentials = encodeBase64(_login.username + ':' + _login.password);
xmlRequest.setRequestHeader("Authorization", "Basic " + credentials);
xmlRequest.send();
}
When I attach a onreadystatechange handler, I can see the the request goes to state 4. I can also see the requests in my server logs. I also added a "no cache" request header, which didn't help. I tried this on a local web-server on a hosting package that I have and I don't have any luck getting it to work.