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

236
Views
How can I link to this area of a page that uses javascript for navigation?

On this page (https://www.hollandhart.com/pet-care) is a blue thumbnail image that, when clicked, I would like to send the user to the News And Insights area of the page, which is at this url: https://www.hollandhart.com/pet-care#newsInsight. Similar behavior to when a user clicks on the "News and Insights" navigation item on the left. However, when I've added an anchor tag around this image to go to https://www.hollandhart.com/pet-care#newsInsight, nothing happens.

The website vendor tells me that the page needs to reload in order for that area to display because of the javascript being used. If you click on the page navigation items to the left, you'll notice that the page reloads and then displays the related content. So, because the anchor tag code I'm using isn't forcing a page reload, the anchor tag isn't effective.

I've tried the following code, but it doesn't seem to work:

<a href="https://www.hollandhart.com/pet-care#newsInsight" onclick="window.location.reload(true);"><img align="right" alt="" height="51" src="/webfiles/Images/Pet_Care_Industry_Widget_Final.png" width="300" /></a>

Any other ideas???? Please know that this is a CMS with a visual editor, so any code between script tags will likely get stripped out by the CMS. I would need to be an inline solution.

Any help would be greatly appreciated. THANKS!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Store the desired anchor ref in session storage, and then trigger a reload.

When the page loads, check session storage for a "desired anchor ref"; if you find one, use scrollIntoView on the targeted element, and delete the "desired anchor ref" from session storage.

--

You might be able to get all that into an inline click handler.

about 4 years ago · Juan Pablo Isaza Report

0

Looks like the website vendor was able to get this done. Some of this is probably code that only works with their CMS, but here's what they did, if you're curious:

<a href="javascript:void(0);" onclick="event.preventDefault();$('.assocType a[data-tag=newsInsight]').click();return false;"><img align="right" alt="" height="51" src="/webfiles/Images/Pet_Care_Industry_Widget_Final.png" width="300" /></a>
about 4 years ago · Juan Pablo Isaza Report
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!