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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:06:59+00:00 2026-06-12T09:06:59+00:00

I am having problems in redirecting page with jquery. I have a variable url

  • 0

I am having problems in redirecting page with jquery. I have a variable url which contains localhost/abc#123. When i write document.location.href = url;, the page redirects to localhost/abc leaving #123. How to resolve this issue

  • 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-12T09:07:00+00:00Added an answer on June 12, 2026 at 9:07 am
    var url = "http://bing.com/refresh/test.html#123";
    
    document.location.href=url
    

    it’s work fine for me in my firefox. do you have tried to debug what happen on your side. I have test this code in IE8 + firefox + chrome. I hope it’s will work fine for you.

    if this code doesn’t work on your side then try

    window.location.replace(url)
    

    as your comment it’s look like you have used Anchor so tried this one.

    $("#myanchor").click(function(e){
    e.preventDefault();
    
    // redirect code here
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, Here's the problem I'm having. I have a page which redirects directly to
Im having problems with displaying ONLY some elements ONLY on print page. For example
Im having problems getting at the HTML5 video tag with jQuery. Here is my
Im having problems with classpaths. I have used them before with import but I'm
I am having a problem with redirecting a page from example.com (to) www.example.com The
We are facing problems in URL Redirecting 4 URL's to a single URL. The
Hi guys I'm having problems with the following virtual hosts: <VirtualHost *:80> ServerAdmin webmaster@localhost
I'm having trouble with passport.js using the local strategy. I have 2 specific problems:
I have an issue I'm having trouble :/ err404 page's 200OK header status problem,
I'm having problems redirecting stdio of another program using subprocess module. Just reading from

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.