Creating unique URL links for reach tab

I’ve been trying to implement a code from this post without success:

I already changed the tabs ID and classes, but I still don’t see what I’m doing wrong. Any ideas?


Here is my site Read-Only:

Hey Daniel, you shared your preview link twice, what is the post you are referencing?

Sorry about that. I was referring to the tabs on this image

Ah, but you mentioned a forum post that you’re trying to implement?
That link is missing.

Sorry, again. Here is the link:

There are a few more posts with the same code on the forum. But I use this one as a reference.

Ah that solution isn’t designed to handle URL encoding, and your tab names have spaces, which is why you see #Tab%202 in your querystring.

You can compensate for that in your changeTab function;

function changeTab() {
  var tabName = window.location.hash.substr(1);
  // Fix encoded spaces 
  tabName = tabName.replace(/%20/g, ' ');
  var tabEl = $('[data-w-tab="' + tabName + '"]');
  if (tabEl.length) {;

That worked perfectly!!!
Many thanks :slight_smile: