The code returns readable html from a partial view but will not render to a Bootstrap modal using JQuery. The error is below, commented out are various attempt. I'm pretty sure it is something to do with the DOM but the interweb is not being very forthcoming
$('#frm').on('submit', function(e) {
e.preventDefault();
alert("clicked");
var url = '@Url.Action("makePayment", "accounts")';
var model = $(this).serialize();
//console.log(model);
//$.post(url, model, function(res) {
// console.log(res);
// $('.payModal').modal('show');
// $(".payModal").html(res);
//});
var outcome = "";
$.ajax({
url: url,
type: 'POST',
dataType: 'json',
data: model,
//dataType: 'html',
//contentType: html,
//processData: true,
//contentType: false,
processData: false,
//cache: false,
success: function(data) {
outcome = data;
//console.log(data);
//$(document).ready(function() {
$(document).find("#payModal").html(data);
$(document).find("#payModal").modal("show");
//});
}
});
//$("#payModal").html("<p>Hello World</p>").delay(5000);
//$("#payModal").modal("show");
});
Error -
