Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6857677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:03:25+00:00 2026-05-27T02:03:25+00:00

When I add a HTML link to a specific part of the page: <a

  • 0

When I add a HTML link to a specific part of the page:

<a href="#specific">test</a>

I noticed that it changes the URL at the address bar. Although I have come across websites where they link that way without the address bar being updated. How is this possible?

EDIT: It might be an AJAX solution were they make it work without URL change, as if I remember correctly, the page didn’t reload, it went directly to the destination…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:03:25+00:00Added an answer on May 27, 2026 at 2:03 am

    You may wish to look at the jquery plugin, scrollTo.

    http://jquery.com

    And a couple of links for scrollTo

    http://demos.flesler.com/jquery/scrollTo/

    http://flesler.blogspot.com/2007/10/jqueryscrollto.html

    You can do something like this:

    The HTML

    <a href="#scrollToMe" class="scrollLink">click me to scroll</a>
    <div class="gap">a big gap</div>
    <h1 id="scrollToMe">I should scroll to here without a # in the URL</h1>
    

    The javascript (jquery and the scrollto plugin)

    $(document).ready(function() {
        $(".scrollLink").click(function(e) {
    
            $.scrollTo($(this).attr("href"));    
            e.preventDefault();
    
        });
    
    });
    

    What the javascript does, is when ever a link is clicked that has the class “.scrollLink”, scroll the page down to the element that has the same ID, as the href for the particular link clicked. Then the e.preventDefault() stops it working like the normal hash link and stops it appearing in the URL bar.

    Here is a working example for you: http://jsfiddle.net/alexkey/c3jsY/7/

    And a version not in a frameset, so you can see that the URL doesn’t change:

    http://fiddle.jshell.net/alexkey/c3jsY/7/show/light/

    This approach has a couple of good points

    1. Simply apply the scrollLink class to links you want to stop the hash appearing (nice and easy)
    2. It uses the normal href, which also means the links will still work even if javascript is disabled – good for accessibility and probably search engine optimisation to.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add a link to every image in the HTML with the
Checking the HTML source of a question I see for instance: <a id=comments-link-xxxxx class=comments-link>add
My URL is: http://www.metroflatsmiami.com/listing/add.html Any help?
$('#post_form').submit(function() { $(#ajax_bar_loader).show(); $.ajax({ url: 'add.html', data: $('#post_form').serialize(), dataType: 'json', type: 'post', success: function(
I'm trying to add some jQuery + ERB to a specific view: views/posts/show.html.erb (top
I have a link like: HTML: <a href=# title=> <img src=stack.png alt= title= />
I have a html page, where i would like users to come and edit/add
I am trying to add an html link to a website but the website
i wanted to give a link at html page to download. as i am
I generate in a foreach loop html links (test which I add to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.