0

Can anyone tell me how I can remove a # value in adres bar in case of a jquery.addres.value

This is my code in a existing wordpress theme. I have setted SEO urls but the # is still in url after click on menu item.

var path = (base + "/" != jQuery(this).attr('href'))      
    ?jQuery(this).attr('href').replace(base, "") : "/";

jQuery.address.value(path); 

Regards

Dipesh Parmar
  • 27,090
  • 8
  • 61
  • 90
Paul Maas
  • 55
  • 1
  • 1
  • 8
  • If you don't need the `#` for browser history related functionality, you could just `return false;` from the menu _click_ JavaScript function which will stop the `#` ever being added (if you have such a function of course!) – andyb Apr 25 '13 at 08:33
  • If I use onclick="return false;" the link click does not work anymore. I cannot navigate to the page in that case. – Paul Maas Apr 26 '13 at 06:32
  • I was only suggesting investigating that approach. It was a guess since you didn't post any other relevant code so it is difficult to answer. Could you edit the question and add the relevant HTML and JavaScript that demonstrates the problem please? – andyb Apr 26 '13 at 07:41
  • Are you worried that the `#` will affect SEO? http://stackoverflow.com/questions/6370561/do-google-and-bing-crawlers-treat-hash-tags-in-urls-as-get-parameters might help – andyb Apr 26 '13 at 13:47

1 Answers1

0

Try this,

var url=jQuery(this).attr('href');
var temp=url.split('#');
url=temp[0];
jQuery.address.value(url); 
Shijin TR
  • 7,516
  • 10
  • 55
  • 122
  • If I use onclick="return false;" the link click does not work anymore. I cannot navigate to the page in that case. – Paul Maas Apr 26 '13 at 06:31