Load HTML into Div via Ajax

0

I would like to get the answer from ajax, and load the div ...

If I load the div, passing the url works 100%

var detalhamentoDiv = $("#detalhamentoDiv");
detalhamentoDiv.load('/Exemplo/Controller/Teste');
$('#detalhamentoDiv').modal('show')

But the problem is that I want to load the div with the ajax response.

$.ajax({
    url: "/Exemplo/Controller/ConfirmarDados",
    type: "post",
    data: postForm, //dados
    success: function (response) {
        var detalhamentoDiv = $("#detalhamentoDiv");
        //como carregar a div com a response??
        //detalhamentoDiv.??
    },
    error: function (jqXHR, textStatus, errorThrown) {
        console.log(textStatus, errorThrown);
    }
});

C # code

 public ActionResult ConfirmarDados()
 {
    var model = ...;
    return PartialView("_ModalDialog", model)
 }

Thank you ..

    
asked by anonymous 03.09.2016 / 17:20

1 answer

1

Do this:

...
success: function (response) {
    $("#detalhamentoDiv").html(response);
}
...
    
03.09.2016 / 18:01