var strConvert = "A%2F2%2E2%28C%29%27";
var arySplit = strConvert.split("%");
if (Object.prototype.toString.call(arySplit) === '[object Array]') {
for (var i = 0; i < arySplit.length; i++) {
if (i === 0) {
strOutput = arySplit[i];
}
if (i !== arySplit.length - 1) {
strHex = "%" + arySplit[i + 1].substring(0, 2);
Letter = decodeURIComponent(strHex);
strOutput = strOutput + Letter + arySplit[i + 1].substring(arySplit[i + 1].length-1);
}
}
alert(strOutput);
}
salam otai semua, berdasarkan script kat atas, output skrg adalah :
A/2.2( C )9'7
output yg sepatutnya :
A/2.2( C )'
pening fikir.. script ni sy convert dari vbscript..
code asal strOutput = strOutput & Letter & Right(arySplit(I + 1), Len(arySplit(I + 1)) - 2).
Mohon ada yg sudi bantu..terima kasih.