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

175
Views
The embedded widget script unable to generate its html inside React env

I wanted to load a survey widget in the react project, where I create and execute the script in the head after dom gets loaded. But it is unable to generate its poll HTML.

Here is react demo in codesandbox

If I load the same script inside the specific element in the body without react env it works, here it's demo in jsbin

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <h1>Polldaddy Title</h1>
 <div id="pollDaddyInfo"> 
   <p>Poll should generate below this statememt</p>
   <script charset="utf-8" src="https://static.polldaddy.com/p/10962229.js"></script>
 </div>
  <h1>Polldaddy End</h1>
</body>
</html>

Help me to identify what could possibly go wrong?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There is nothing wrong with your implementation in either scenario (i.e. with and without react environment).

Actually, in react environment you're loading the script which is async operation and an script that is loaded asynchronously cannot write on the document with document.write which is happening here

https://docs.google.com/document/d/1v3qxRRU7aPs7rk_RwsDPDwuE22Yi1KG_oyKmmgD3lGY/edit?usp=sharing

For supporting my argument here is another thread on stack overflow

about 4 years ago · Juan Pablo Isaza Report
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!