Please pardon me asking this rudimentary question, but let me know if anyone knows about it.
I’m developing a web application for smartphones, and want to make a native application of it for iOS, Android, and so on by PhoneGap.
In my script I use Ajax in order to send and get data from a php file in a server.
$.ajax({
url: "example.php",
cache: false,
data: data,
success: function(result, dataType){
}
});
If I change url: “example.php” in the above to, say, url: http://www.example.com/example.php, will a native application send and get data from example.php in a server?
I would appreciate if anyone who knows about it could help anserwing my question.
Thank you.
Yes, but you have to whitelist the url. whitelist documentation
And be careful with iOS 6, it caches the ajax responses, take a look to this topic
iOS 6 caching problem