Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

161
Visualizações
How to bypass parsing while setting innerHTML in JavaScript

Disclaimer: I read a lot of stuff regarding parsing and bypassing of [innerHTML] in Angular. Found few solutions which includes creating a pipeline and bypass the URL or HTML etc.

Still not able to find out a good solution.

Problem: While providing my HTML to DOMParser() or setting directly the HTML, it parses it (by default) which leads to inappropriate/unwanted results.

I have HTML which contains this line.

<table border="0" cellpadding="0" cellspacing="0" style="text-align:left;font-size: 15px;" width="100%"> <tbody>${shipmentData.order_items.map((items, i)=>{return ` <tr>...</tr>`})}

While passing this to DOMParser or innerHTML it gets converted into below code

${shipmentData.order_items.map((items, i)=&gt;{return ` `}).join('')}<table style="text-align:left;font-size: 15px;" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr>

I tried many solutions as stated above in disclaimer and also tried setting things using replaceChildren() or append() etc., but none gets the output I want.

Is there any way around to set HTML without parsing to any element?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda