I am attempting to use $.ajax. Based on this response I will show or hide some container. The problem is that in Chrome the response comes back fine and the success callback works just fine. However, in Firefox the response is coming back as undefined. I attempted to set the datatype to json and then parse the json once the response comes back but that didn't work either. I just got an error saying that the data was incomplete and couldn't be parsed.
Here is the javascript:
var infoId = $("#infoId").val();
$.ajax({
type: "GET",
url: "http://localhost/HartvilleServices.Enrollment/Participation",
data: "userInformationId=" + infoId,
processData: false
})
.error(function(x, s, e) {
$("#thankYou-container").css("display", "none");
$("#survey-container").css("display", "block");
})
.success(function (data) {
$.each(data, function (key, val) {
if (val.hasResponse == "False") {
$("#thankYou-container").css("display", "none");
$("#survey-container").css("display", "block");
} else {
$("#thankYou-container").css("display", "block");
$("#survey-container").css("display", "none");
}
});
});
Can anyone give me some insight? I have never noticed this issue before.