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

93
Vistas
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 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