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

172
Visualizações
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 à 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