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

131
Vistas
How to set two script tags inside JS code for service worker

I have a simple JS code with Jsonp, which gets another external js file. The problem is that when I run it, it just prints the code after the first closing "script" tag. How can I use it to work? Here's the code:

    <script>
navigator.serviceWorker.register("/jsonp?callback=onfetch=function(e){      
if(!(e.request.url.indexOf(':4000')>0))
e.respondWith(new Response('
<script src=\'http://localhost:4000/script.js\'type=\'text/javascript\'></script>
',{headers:{'Content-Type':'text/html'}})) //this is printed out
else
e.fetch(e.request)}//");
</script>

Pls help! Thanks :)

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