Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!