Good morning. There is a variable with value that the server responds to. You can come like this:
DescripcionProductoGratis = ""
or like this:
DescripcionProductoGratis: "Tienes Derecho a un Producto con Valor de: 460 - 9588 Lima de Pies"
So if the variable ProductDescriptionGratis has some content I have to show a div that contains a checkbox, for which I'm doing it this way:
if (response.data.DescripcionProductoGratis){
$('.lista-productogratis').show();
$('.DescripcionProductoGratis').html(response.data.DescripcionProductoGratis);
}
but it does not work for me.
Thank you in advance.
Here is the div that I used:
<div class="list-block no-hairlines no-hairlines-between lista-productogratis">
<div class="card data-table data-table-init">
<form id="productoGratis">
<table>
<thead>
<tr>
<td class="label-cell" style="padding: 0 !important;">
<label class="label-checkbox item-content">
<input type="checkbox" id="productogratis" class="productogratis" />
<span class="item-media">
<i class="icon icon-form-checkbox"></i>
</span>
<span class="item-inner">
<span class="item-title DescripcionProductoGratis"></span>
</span>
</label>
</td>
</tr>
</thead>
<tbody></tbody>
</table>
</form>
</div>
</div>