I have an ajax call in the head section of my index.html
$(function() {
alert("Hello, World!");
$.ajax({
method: 'get',
url : 'php/getRecord.php?color=red',
dataType: "json",
success: function (data) {
alert(data);
}
});
});
For some reason, that alert(data) never gets called but the "Hello, World!" gets called. Am I doing something wrong? The PHP file does give me data when testing it directly.