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

102
Visualizações
Display dynamic information based on url with Twig

I would like to change the information I display on the page based on the url by adding '?id=(x)' at the end. I have an Api with products that have an ID, name and gender.

[{0:{id:1, name:'item1', gender:'toy'}}, {1:{id:2, name:'item2', gender:'it'}}]

    <div class="items">
      <h1 id="name"></h1>
      <h2 id="gender"></h2>
    </div>

I would like that at the end of the url adding ?id=1 for example it would show me the name and the gender on screen and if I change in the link the 1 for the 2 I would get the information of the other item. If it is also possible to do it with pure Javascript that could also be an option.

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
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