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

337
Views
¿Cómo incluir un script externo en <script>?

Dentro de mi función JS necesito agregar esto:

 < script src=https://xxxx.com/c3.js type="text/javascript" async defer>< /script>

¿Cómo editar el código de la manera correcta?

 <script> function affilate() { var ab_instance = "xxx.com"; var ab_kampan = 3; var ab_cena = 1; var ab_id_transakce = document.getElementById("email").value; <script src=https://xxxx.com/c3.js type="text/javascript" async defer></script> console.log(ab_id_transakce); } </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si entiendo su pregunta correctamente, está intentando agregar una etiqueta de secuencia de comandos al DOM. Parece que está intentando agregar la etiqueta de secuencia de comandos HTML en la función de Javascript, que no funcionará. Lo que puedes probar es:

  1. Agregue la etiqueta del script directamente en el HTML de esta manera:
 <script src=https://xxxx.com/c3.js type="text/javascript" async defer></script> <script> function affilate() { var ab_instance = "xxx.com"; var ab_kampan = 3; var ab_cena = 1; var ab_id_transakce = document.getElementById("email").value; console.log(ab_id_transakce); } </script>
  1. Agregar la etiqueta de secuencia de comandos de forma dinámica
 <script> function affilate() { var ab_instance = "xxx.com"; var ab_kampan = 3; var ab_cena = 1; var ab_id_transakce = document.getElementById("email").value; console.log(ab_id_transakce); var script_tag = document.createElement("script"); script_tag.src = "https://xxxx.com/c3.js"; script_tag.type = "text/javascript"; script_tag.async = true; script_tag.defer = true; // in case you want to add the script tag to the <head> document.head.appendChild(script_tag); // in case you want to add the script tag to the <body> document.body.appendChild(script_tag); } </script>
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!