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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:59:46+00:00 2026-05-25T17:59:46+00:00

i want to store and retrieve data via the url hash. the user is

  • 0

i want to store and retrieve data via the url hash. the user is able to make some dropdown settings on the page, which should get written into the url via the location.replace function*.

for simplicity’s sake, it now works like this: initially, the user is on test.com. after changing two settings, the url looks like this: http://test.com#fruit→banana#color→light blue.

another almost as simple way would be http://test.com#fruit=banana, color=light blue. the only characters the settings and options contain are (as regular expression) [A-Za-z &]

as far as i can tell, this works fine, although firefox url-escapes everything on copying, and chrome doesn’t. after pasting and pressing enter, the url bar shows the unescaped hash, fetching location.hash per javascript also gives the unescaped unicode string.

my question: are there any probblems, inconsistencies, or other quirks i don’t know about?


*FYI: location.replace("#hash") works just like one would expect 😀

  • 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-25T17:59:46+00:00Added an answer on May 25, 2026 at 5:59 pm

    As i already noted in the comment, forget

    location.hash 
    

    and use

    location.href.replace(/^[^#]+/,'');
    

    instead.

    It will save you a whole heap of trouble.

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

Sidebar

Related Questions

I want to store and retrieve images to/from database using java beans, which data
i want to be able to store and retrieve data online using a username
I store some dates in my NSMutableArray, I want to retrieve them and change
I'm trying to use $.data() for the first time. I want to store some
I want to store the current URL in a session variable to reference the
I want to store the data returned by $_SERVER[REMOTE_ADDR] in PHP into a DB
I want to store a very large amount of vector data on a server
I am using PostgreSQL i want to store JSON data into table column. Later
I have an XML file and I want to retrieve data from it so
I need to store some sensitive data by encrypting it with atleast 128 bit

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.