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

174
Vistas
External link in Thymeleaf pointing to site with two # tags which show collapsed items

I'm trying to create a Thymeleaf link which will redirect to another site with 2 accordeon bodies already open.

On page 'exercises' I've got collapsible items that appear when I call them by passing value in URL, like:

/exercise#Category

I've done that by using following JS script:

        $(document).ready(function () {
        if(location.hash != null && location.hash != ""){
            $(location.hash).collapse('show');
        }
    });

The questions are:

  1. Is there possibility to pass 2 ids of hidden elements to show them both? The problem is - body I want to display is inside another collapsed item, so to show it I have to display both of them.
  2. How is it possible to create Thymeleaf link which will point to this site, with 2 given parameters?

To create link i've tried following, but it doesn't work.

th:onclick="'window.location.href = \'' + @{/exercises#${exercise.getCategory()}} +  '\''">

Which resulted in not converting variable to String, so i've got in browser:

/exercises#${exercise.getCategory()}
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