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?