Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!