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 8514341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:50:23+00:00 2026-06-11T04:50:23+00:00

I am using a script to add a hash tag to the URL of

  • 0

I am using a script to add a hash tag to the URL of the page. (I know I could just type the link as url.com/page.html#align-page but for users who come to the page without the hash tag I add it dynamically to direct them to the spot I want.)

I can see the hash tag added in the page URL but it sometimes goes to the correct div and other times it doesn’t.

Why does this not work 100% of the time?

Here is the script (this script is in the <head>)

var $j = jQuery.noConflict();
  $j(document).ready(function(){    

     window.location.hash = "align-page";

});

Note: The script is contained within the $j(document).ready(function(){ as there are other scripts that are not listed here that are also within the { }. If it needs to be placed outside of the { } I can move it.

Also if there is a better way to do this with jQuery or another method I would welcome that.

  • 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-06-11T04:50:25+00:00Added an answer on June 11, 2026 at 4:50 am

    Try this instead:

    var $j = jQuery.noConflict();
      $j(document).ready(function(){    
    
         window.location = "#align-page";
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this code: <script type='text/javascript'> $(document).ready(function () { //Check if url hash value
I am using a script from http://www.yourinspirationweb.com/en/jquery-how-to-create-a-news-ticker-with-just-a-few-javascript-lines/ which is a great newsticker, designed to
Am creating a script using JQuery on an ASP.NET page. Have a JSON string
I'am trying to add certificate to CurrentUser location using certmgr in script: certmgr.exe -add
I am writing a Greasemonkey script using jquery, and I want to add information
I am using the following script to add default values to input text boxes:
I would like to declare the following type in my powershell script: Add-Type @'
I am trying to add rows to my repeater using jQuery using below script.It
I'm using script at Run exe after msi installation? to add a run application
I'm using this script to add text to a variety of .txt's on the

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.