Clean URL from anchors

Clean URL from anchors

Hi there,

I'm completely new in jquery (and this is my first post here). I'm using anchors on a website and I am keeping the #nameoftheanchor after the URL. I'm using this code for a "To top" animation link:

  1. $(function(){
  2. $.easing.def = "easeOutExpo";
  3. $(window).scroll(function(){
  4. if ($(this).scrollTop() > 100) {
  5. $('.scrollToTop').fadeIn();
  6. } else {
  7. $('.scrollToTop').fadeOut();
  8. }
  9. });
  10. $('.scrollToTop').click(function(){
  11. $('html, body').animate({scrollTop : 0},1000);
  12. return false;
  13. });
  14. });
The thing is, I'd like to get the URL clean of anchors after clicking on this "To top" link.

Any help? Thanks in advance.