I'm trying to update my HTML UI with data returned from a server running on an embedded system (means I have full control over what is returned). The data callback in the .ajax function never seems to be called however, why would this be?
The jQuery code is
$(document).ready(function() {
$('#pollGps').click(function() {
alert('calling /pollgps.json');
$.ajax({
url: '/pollgps.json',
dataType:'json',
success: function( data ) {
alert('success ' + JSON.stringify(data));
$("#settingId").html(data.settingId);
$("#settingValue").html(data.settingValue);
}
error: function(jqXHR, textStatus, errorThrown) {
alert('Error polling GPS ' + textStatus);
}
});
});
})
and the server response is
HTTP/1.0 200 OK
Content-Type: application/json
{
"settingId"="CFG-NAV2",
"settingValue"="0xdead"
}