I am trying to get the decoded value for the string. I notice that decodeURI (i am not using unescape because i read somewhere that its deprecated) works when i do a document.write(), but the alert still shows the non-decoded value.
var uri = "Hello's ";
var dec = decodeURI(uri);
alert(dec);
document.write(dec);
I finally used the below code and things worked;
var strName = $('<div/>').html("Hello's").text();
but still wondering why the original code doesn't work? It seems to be a pretty straightforward use case.