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

220
Views
How to decode URI string using javascript?

So I'm trying to decode this string %21%22%23%C2%A4%25%26%2F to !"#¤%&/ inside my confirm so it doesn't say the encoded string in the confirm, but the actual string. But how can I do this?

I tried something like this, but it doesn't work.

...
if(confirm('Are you sure you want to removed the JQL: ' + decodeStr(encoded_string_value))){
...
}

function decodeStr(strVal) {
    var decodeStr = '';
    if(strVal && typeof strVal === 'string') {
        // strip script/html tags
        decodeStr = strVal.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
        decodeStr = decodeStr.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
        return decodeStr;
    }
}

Is there another way of doing this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Did you try?

decodeURI(strVal)

or

decodeURIComponent(strVal)
about 4 years ago · Juan Pablo Isaza Report
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!