Mayeenul Islam
Mayeenul Islam

Reputation: 4762

Defining HTML <base> URL is hacking all the hashed (#) anchor tag going base

I'm stucked in my own solutionit's THE real problem what I wanted to solve. I defined my <base> URL in my PHP project, now all the hashed links

<ul class="nav nav-tabs nav-justified">
     <li role="presentation" class="active">
          <a href="#">Tab Handle</a>
     </li>
</ul>

are taking me to the base. It's not just the tab, it's everything: If I provide a hashed <nav> element, it's also taking me to the base URL (home URL).
And that's taking a page refresh so, which is another awkward situation.

How can I solve this?

Upvotes: 0

Views: 238

Answers (1)

Mayeenul Islam
Mayeenul Islam

Reputation: 4762

Okay, I got a solution. Thanks to @Adam.

<base href="http://localhost/project/">
<ul class="nav nav-tabs nav-justified">
     <li role="presentation" class="active">
          <a href="javascript:">Tab Handle</a> <!-- it'll work like a hash link -->
     </li>
</ul>

Upvotes: 1

Related Questions