javascript - Make onclick function return url without hash -
i trying variable local page link i'm trying this:
<a href="#mylink" data-toggle="tab" onclick="location.href=this.href+'?currenttab=mytab;';return false;">mylink</a> this returns:
http://mysite.php#mylink?currenttab=mytab is there way of stopping displaying hash? want show variable.
for example:
http://mysite.php?currenttab=mytab
simply make href attribute empty. valid , fix issue.
note, however, little preview appears on bottom left corner of browser misleading. unless have reason use javascript, it'd better include query string (which hard coded anyway) href.
hover on both links in snippet below see i'm talking about.
<a href data-toggle="tab" onclick="window.location = location.href +'?currenttab=mytab;';return false;">link</a> <a href="?currenttab=mytab" data-toggle="tab">link</a>
Comments
Post a Comment