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

157
Views
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
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!