function TestEncoding()
{
var inputString=document.forms["TestEncodingForm"]["inputString"].value;
var encodedInputString=escape(inputString);
encodedInputString=encodedInputString.replace("+", "%2B");
encodedInputString=encodedInputString.replace("/", "%2F");
document.forms["TestEncodingForm"]["encodedInputString"].value=encodedInputString;
}
Type anything on the Not encoded field, when you press the URL Encode button, the encoded string will be displayed on the Encoded field. Alternatively, type anything on the Encoded field, when you press the URL Decode button, the decoded string will be displayed on the Not encoded field. |