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

192
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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