The following extract calls a php file that retrieves some info from a database and returns the values which are then used to update my page. Works perfectly on standard browsers but as soon as I try it on a mobile it fails to update.
//function - Retrieve Stats from mysql
$(function(){
$('.sessionset').on('click', function(e){
//Retrieve Approach details onclick of an Approach button
$.ajax({
type: 'POST',
dataType: 'json',
url: '../_includes/retrieveStats.php',
data: {approach: $(this).attr("alt")},
success: function(data) {
$("#approach").html("Départ "+data[0]);
$("#stats").html(data[1]);
$("#summary-description").html(data[2]);
}
});
});
//End function - Retrieve Stats from mysql
});
RetrieveStats.php uses
echo json_encode(array($approachDisplayName, $approachStats, $summary));
to return the required values.
I'm a relative newbie to ajax so any thoughts or comments would be very much appreciated.