Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

260
Views
Encode special characters in URL for history.replaceState() : javascript

For my application in Javascript, I have to construct a URL which contains a param called 'name', whose value contains few special characters like

'.', '(', ')', '|', '#', '^', ',' etc

Eg: ../app/quest?name=list#2|#3

Due to some application restrictions, I have to encode only the special characters '|' and '^' in the name value.

I replaced '|' in "list#2|#3" with its encoded value "%7C" as "list#2%7C#3" and updated the URL using history.replaceState(stateObj, unused, url). But the value is not encoded and is passed as "list#2|#3" only.

How can forcefully pass the value in its encoded format itself ?

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!