I'm making an ajax call like this below where I'm returning a view like this
return View("Finish");
This has the entire html page as a string as the response, so I want to replace the page with it, but when I do I receive an error
Unhandled exception at line 82, column 3 in https://localhost:44368/Scripts/jquery-3.1.1.js 0x800a138f - JavaScript runtime error: Unable to get property 'appendChild' of undefined or null reference occurred
Funny thing is it does set the html so I see the correct page on screen, I just see the exception in JQuery as well!
var options = {
url: scope.enumControllers.saveEvent,
type: "post",
data: viewModel
};
$.ajax(options)
.done(function(response) {
if (response.error === true) {
yb.base.eventAlert(response.message, "error");
} else {
$("html").html(response); // error here trying to set the page to the response html string
}
})
.always(function() {
})
.fail(function(jqXHR, textStatus) {
yb.base.eventAlert("Error saving data. Please contact the help desk.", "error");
});
User contributions licensed under CC BY-SA 3.0