I have created a simple PhoneGap application using PhoneGap Build. I have a MySQL DB and write a simple PHP file to read some data from it and give it as JSON format. I try to read that info in an HTML file in a PhoneGap application but my mobile does not show anything. Anyone can help me to find the problem? I also add cordova-plugin-inappbrowser plugin in my app. here is the code example I used:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>READ JSON Example (AJAX)</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
type: "GET",
url: "http://phonegappro.esy.es/test/json.php",
crossDomain: true,
cache: false,
success: function(result){
var result=$.parseJSON(result);
$.each(result, function(i, field){
$("#output").append("Title: "+ field.title + " duration: "+field.duration +" Price:"+field.price+"<br/>");
});
}
});
});
</script>
</head>
<body>
<div id="output"></div>
</body>