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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:39:16+00:00 2026-05-26T17:39:16+00:00

I have such url – http://www.coolsite.com/daily-plan/#id=1 What the easiest way to parse that string

  • 0

I have such url – http://www.coolsite.com/daily-plan/#id=1
What the easiest way to parse that string and read a hash value (the value after #id=)?
Thank you

  • 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-26T17:39:17+00:00Added an answer on May 26, 2026 at 5:39 pm

    On client side (i.e. from JavaScript) you can check window.location.hash to get hash. On server side, general answer is ‘it is impossible’ since hash is not sent in request to server.

    Upd: I maybe misunderstood the question. My answer is about how to get hash part of url either in browser or in server side code during request processing, not about string processing.

    Upd2: Answer to comment here because it doesn’t fit in comment.

    How does it work when user clicks on your navigational links?

    I assume hash is changed and corresponding content is downloaded via AJAX request from web service or REST.

    For example if your user has URL http://www.example.com in his browser and this page shows a list of product categories. User clicks one category and URL changes to http://www.example.com/#id=5 and products from that category(with ID=5) are downloaded via AJAX and shown on the page. No postback, only partial page refresh.

    Is this close to your scenario?

    Now you want user to paste/enter http://www.example.com/#id=5 directly in the browser address bar and go directly to list of products in that category.

    But /#id=5 is not sent to server with request by the browser, so there is no way to get that value on server side, and you can do nothing about it since it is the browser decided not to send this data and you don’t have it on server side.

    In our project we use solution when server returns only common page code/html, i.e. header, footer, without main/center part of the page. Then there is a JavaScript code which executes right after this common HTML loaded. It takes window.location.hash and sends it to web service via AJAX and web service returns content (HTML) for the main part of the page.

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

Sidebar

Related Questions

Let's say I have a url such as... http://www.example.com/ random-garbage-here-i-dont-want-12392 /video 2983439 Is there
I have a url such as the example below http://www.website.com/page.php?pid=263547322425&foo=too How can i use
Let's say I have a url such as: http://www.example.com/hello.png?w=100&h=100&bg=white What I'd like to do
I have a Ajax heavy application that may have a URL such as http://example.com/myApp/#page=1
I would like to have a URL such as www.google.com/ and a user input
If i have a url such as this http://example.com/controller/action every thing works find. as
Say I have a URL such as: http://ほっけがおいしい.com If I put this in any
I need to have a URL such as http://example.com/controller/my-page-with-dashes How can I have such
So if I have a URL such as mysite.com/user/1234/show which object can I use
Let assume we have such URL: dvb://1.3f3.255c.15 my question is how to parse this

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.