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

219
Visualizações
Code structuring - How to include a file (JS, PHP, etc...) into HTML

how are you?

I want to structure my code as carefully as possible, but I don’t know how to do it. In a single file, I have PHP, JS and HTML code and I was wondering if it was possible to separate the contents by including their "path" in the html code.

For example, how I can separate the php code as well as the js code:

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   { js code }
   { php code }
</body>
</html>```

Thank you in advance for the information I would receive
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use '.php' file as default then just put html into that

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
     <script src="file.js"></script>
     <?php include('file.php') ?>
</body>
</html>
about 4 years ago · Juan Pablo Isaza 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