Data from Ajax to console screen, at the same time, when I look at Browser f12 Network, the data returns successfully as follows. But it does not show in div in some kind of index.blade.php file.
Response Json Data
{"options":"<table>\n <thead>\n <tr>\n <th>Alt Grup<\/th>\n <th>Miktar<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <tr>\n <td>AB<\/td>\n <td>110<\/td>\n <\/tr>\n <tr>\n <td>AC<\/td>\n <td>9<\/td>\n <\/tr>\n \n \n <\/tbody>\n<\/table>\n\n\n\n"}
Ajax Script in index.blade.php
<script type="text/javascript">
$(document).ready(function(){
$('.depo_sec').click(function(){
var depo_id = $(this).children('input:hidden').eq(0).val();
$.ajax({
url: "{{ route('stok-ajax') }}",
dataType: 'json',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
method: 'POST',
data: {depo_id:depo_id},
success: function(dataHTML) {
$('#ajax-area').html(dataHTML);
console.log(dataHTML);
}
});
});
});
</script>
I want to display ajax data into the div id="ajax-area".
index.blade.php
<div class="row">
<div id="ajax-area"></div>
</div>
It does not give any errors but does not print anything on the page.