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

190
Views
Calling code from a single Javascript file instead of calling intepedent Javascript files

I use a cookie consent policy banner from https://www.freeprivacypolicy.com which calls JS script files according the category they belong.

Fore example: <script type="text/plain" cookie-consent="tracking" src="google-analytics.js"></script> is called when users enable tracking cookies and <script type="text/plain" cookie-consent="targeting" src="google-adsense.js"></script> is called when users enable targeting cookies related to advertisement.

Is it possible to put all the relevant Javascript code in one file and instead of calling certain files according to the users' preferences to call the relevant functions in their place? Or is using separate files the only possible way of implementation?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Yes, you could put them all in one file if you wanted to and call the relevant functions, I would ask why they may be in separate files in the first place though normally the developer has done it for a reason.

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