AJAX response empty on phone, but correct on desktop browser test
So I have a server that is hosting a PHP file that looks like this:
<?php
header('Access-Control-Allow-Origin: *');
?>
Testing, testing
Then I have an AJAX request on my PhoneGap index file in a document ready
that looks like this:
$.ajax({
type : "GET",
url : "http://example.com/PhoneGap/test.php",
crossDomain: true,
success : function(response) {
alert("\""+response+"\"");
},
error : function() {
alert('Not working!');
}
});
But whenever the app starts all that pops up is an alert window that
contains "". However, when I run the index page on my desktop browser, I
get "Testing, testing", which is what I expect.
So, anybody know what I'm doing wrong? Any help would be appreciated.
No comments:
Post a Comment