0
I’ve seen another example here on the forum but it didn’t help me much by the amount of items inserted in div
.
$carrinho = '<div class="carrinhoMais">
<a href="carrinho.php">CARRINHO</a>
R$ <label class="totalCarrinho">'.$phpUtil->formataMoeda($semiTotal).'</label>
</div>';
echo '<script>$(".carrinho").html('.$carrinho.');</script>';
I’m not getting popular to div
.
I’ve tried to
echo '<script>$(".carrinho").append('.$carrinho.');</script>';
Also did not give.
I think it’s the amount of html.
Gives the following error.
index.php:214 Uncaught SyntaxError: Unexpected token <
Line 214
<script>$(".carrinho").html(
<div class="carrinhoMais">
<a href="carrinho.php">CARRINHO</a>
R$ <label class="totalCarrinho">12,00</label>
</div>
);</script>
Precisely, the problem was the lack of quotation marks around the html you were trying to insert.
– Simão Ítalo