Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

191
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda