Before posting this question, I did search here and got different answers and I think it doesn't fit to my needs. I have a button when clicked, the following js script will run
$("#update-details-btn").on('click', function() {
$.ajax({
type: 'post',
dataType: 'json',
data: "confirmation="+get_data,
url: '../for_update_details',
success: function(data)
{
console.log(data);
$('div#update_details_body').html(data.results);
and this is the container
<div id="update_details_body" class="modal-body"></div>
the data comes from a php function
$data['results'] = NULL;
$results = "<div class='form-group'>";
$results .= "<label for='document-type' class='col-sm-4 control-label'>Category</label>";
$results .= "</div>";
$data['results'] = $results;
echo json_encode($data);
As you can see from the js, I did a console.log which prints exactly what the data.results contain but when I use .html() to put inside the container, nothing happens. What could be the culprit here? I am doing this coding to other functions but only this section is not working