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

  • Home
  • SEARCH
  • 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 276279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:53:45+00:00 2026-05-12T00:53:45+00:00

I have a use case where I am setting the page focus to a

  • 0

I have a use case where I am setting the page focus to a particular element (having an anchor before it). When a user is not signed in, there is a redirect to the login page and after signing in, the user is redirected to the page in question, with the URL encoded.

I see that a URL of the form link#target works as expected (focusing on the element) while the url encoded link link%23target doesn’t. Is this expected behavior?

Edit: If this is the expected behavior, is there a work around to focus on the target? As in, a way around url encode?

Edit adding more info:
Assuming that there is a code

page1.html
... html before the anchor ...
<a name="test">Some code</a>
... html after the anchor ...

I am accessing the page as page1.html%23test. This doesn’t work the same way as page1.html#test. Is there a jQuery method to implement this? Would location.hash contain test even after it has been url encoded? I have no control on changing the url encoding.

Edit:

As I knew which named anchor I wanted to go to after page is redirected, I did a

window.location.hash = namedAnchor  

to solve the issue. This JS line is output only if a customer is successfully signed in. Solved my issue, though not the generic answer I was looking for. I was looking for a way to avoid escaping of # in url encode.

  • 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-12T00:53:46+00:00Added an answer on May 12, 2026 at 12:53 am

    Yes. Encoding the # as %23 effectively says “I just mean a plain old “#” character, not a URL fragment”. The same is true of other reserved characters: escaping them stops them from having special meaning in the URL.

    In your case you do want to encode the URL when passing it to your login page as a parameter, but your login page should decode the URL before performing the redirect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 253k
  • Answers 253k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You'll find that Hibernate writes the query for an unknown… May 13, 2026 at 9:56 am
  • Editorial Team
    Editorial Team added an answer Before initializing session put this line: ini_set ( 'session.cookie_domain', '.mastersite.com'… May 13, 2026 at 9:56 am
  • Editorial Team
    Editorial Team added an answer When Reporting Services runs a report, it creates a data… May 13, 2026 at 9:56 am

Related Questions

I have a DataGridView, whose DataSource I am setting to a List<T> . T
Does SCP have a problem setting file permissions or have I misconfiguration my server?
I am looking to set up a central point of control for settings that
I have a main class which creates and populates a DataSet and an instance

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.