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

311
Views
Passing concatenated string to javascript to import command

I have the following at the top of my JS code (it's vanilla JS, no libs used)

var parameters = location.search.substring(1).split("&");
var temp = parameters[0].split("=");
l = unescape(temp[1]);
temp = parameters[1].split("=");
p = unescape(temp[1]);
document.getElementById("page").innerHTML = l;


var imsrc = '../js/' + l + '.js';

import sources from imsrc;

The issue is that I am trying to pass the imsrc parameter in to the import and I'm getting an error (Uncaught SyntaxError: missing module specifier after 'from' keyword) returned in the webtools

What am I doing wrong and how can I fix it? Sorry, newbie question.

about 4 years ago · Santiago Gelvez
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!