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

158
Vistas
Load JS script for distant server

I need to load a JS script located on a distant server I own. I'm working on differents projets which all require the same set of functions, that's why I'm using a script which allows me to manage all theses functions at the same time then load them when I need to.

But when I try to load my script from one of my projet I've some CORS policy errors. Do you have an idea of what would be the cleanest way to do this ?

Edit :

I load the script like this :

<script src="https://myServer/script.js" type="module"></script>

I would like to load my function like this :

import {test} from 'app.js';
test();

While app.js on my server is :

export function test() {
    console.log('test');
}

Thx Maxime

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