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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:16:52+00:00 2026-06-12T14:16:52+00:00

I have the below example of a URI that I am requesting on my

  • 0

I have the below example of a URI that I am requesting on my local site in Firefox v15.0.1, I have removed the hostname for brevity.

/search?cat=ngb%26b

and some paging links are shown on the resulting page with href’s like this

?p=2&cat=ngb%26b

that do the below history request on their click event which is using https://github.com/browserstate/History.js/ which uses HTML5 History for it’s state changes from what I know of it.

History.getState().url;

the url History.getState().url is giving me the below, this is passed to an async function on the click event:

/search?cat=ngb&b&p=2

and the history is then adjusting the browsers URI to this

/search?cat=ngb&b=undefined&p=2

and my Async action is failing because the “cat” param is now incorrect.

I can’t URL encode the entire result from getState().url because that would be incorrect.

Is there something I am missing that needs to be done when facing this sort of situation?

Any help would be appreciated. Thanks.

UPDATE:
I am currently debugging this and looking at the object that the getState() function returns.. it has a “data” object property that has the correctly encoded params in it.

Potentially I could spin through and then add them on to the URL i pass to my function that makes an ajax request (instead of passing it the .url property) but this doesn’t sound like a good idea when History is meant to handle hash url fallback for HTML4.

  • 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-12T14:16:54+00:00Added an answer on June 12, 2026 at 2:16 pm

    Answering my own question here.

    I had two issues here, 1 with History.js and another with using JQuery.param in an incorrect situation because that encodes anything you give it to make it valid for URL use.

    To fix some issues with the History.js plugin I found this useful branch
    https://github.com/hrunting/history.js/tree/encoded-uris
    which is still an open pull request but it helped me out a lot
    unfortunately it does require having to re-bundle the changed files and minify them if you need to.

    Once that was changed I also had an issue in the code with using $.param() to add the values in a state object that had been built up based on the values in the querystring. Obviously the “ng%26b” value was already encoded and param was encoding the % so it ends up as “ng%2526”.

    Hope this might help someone in the future anyway.

    Thanks

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

Sidebar

Related Questions

I have an example function below that reads in a date as a string
Hi I have the below example form <form id=search method=GET action=/results> <input type=text name=name>
In the simplified example below I have a DataContext and Repository which I think
Let's consider the below example. There, I have: target MAIN calls target t and
I have posted an example below and the desired result . I saw a
Reproducible example below. I have a simulation loop, within which I occasionally have rows
I have a page (contrived example below) with a Google doc and a download
In the example below, I have a model Proof which contains a foreign key
I have a model defined as below: class Example(models.Model): user = models.ForeignKey(User, null=True) other
I have a basic PHP question, take the code below for example, let's say

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.