Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

178
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda