0
Why can’t you put the idented HTML in jQuery? If I put it in "straight" it works, already if I put it indented, to be easier to edit later, it no longer works. Why?
UNFORMATTED, IT WORKS:
$j('<div class="filters"> <div class="title title--sm lucas"><span>FILTROS</span></div> <div class="filters__list"> <div class="filters__filter cor "> <div class="filters__name">Cor </div> <ul class="ul--0"> <li class="li--0"> <a href="http://roupasatacado.dev.bizcommerce.com.br/roupas-de-academia?cor=73" title="Amarelo" class="a--0"> <span class="label">Amarelo</span> </a> </li> <li class="li--0"> <a href="http://roupasatacado.dev.bizcommerce.com.br/roupas-de-academia?cor=74" title="Azul" class="a--0"> <span class="label">Azul</span> </a> </li> <li class="li--0"> <a href="http://roupasatacado.dev.bizcommerce.com.br/roupas-de-academia?cor=76" title="Branco" class="a--0"> <span class="label">Branco</span> </a> </li> </ul> </div> </div> </div>').insertAfter('main.col-main');
FORMATTED, NOT WORKING:
$j('<div class="filters">
<div class="title title--sm lucas"><span>FILTROS</span></div>
<div class="filters__list">
<div class="filters__filter cor ">
<div class="filters__name">Cor </div>
<ul class="ul--0">
<li class="li--0">
<a href="http://roupasatacado.dev.bizcommerce.com.br/roupas-de-academia?cor=73" title="Amarelo" class="a--0">
<span class="label">Amarelo</span>
</a>
</li>
<li class="li--0">
<a href="http://roupasatacado.dev.bizcommerce.com.br/roupas-de-academia?cor=74" title="Azul" class="a--0">
<span class="label">Azul</span>
</a>
</li>
<li class="li--0">
<a href="http://roupasatacado.dev.bizcommerce.com.br/roupas-de-academia?cor=76" title="Branco" class="a--0">
<span class="label">Branco</span>
</a>
</li>
</ul>
</div>
</div>
</div>').insertAfter('main.col-main');
Thank you, Lucas, I didn’t know that! :)
– Lucas de Carvalho
If the answer answered, could mark as accepted @Lucascarvalho?
– BrTkCa
Yes, of course! I was just waiting, I could not score before 10 minutes I think, but now was.
– Lucas de Carvalho