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 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

Related Questions

I'm just starting to learn AspectJ, and I have use-case for say, User login.
I have following use-case: there are several assemblies decorated with ProtoContract classes and I
I have a use case with NServiceBus explained in this question. Essentially there is
I have the following use case: There's a class called Template and with that
I have a use case where I need to call a (non-static) method in
I have a use case where if a number lies between 0-10 it should
I have this use case of an xml file with input like Input: <abc
I have a use case where I only need to store certain fields to
I am currently evaluating Install4J for my company. We have a use case where
Question: Is there a way to detect what XHtml conformance setting a particular ASP.Net

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.