URL Decoder—Convert garbled address

/* <form onsubmit="return false;" action="#"> <textarea cols="40" rows="20" id="dencoder"></textarea> <div> <input onclick="decode()" value="Decode URL" type="button"> <input onclick="encode()" value="Encode URL" type="button"> </div> </form> */ function encode() { var obj = document.getElementById('dencoder'); var unencoded = obj.value; obj.value = encodeURIComponent(unencoded); } function decode() { var obj = document.getElementById('dencoder'); var encoded = obj.value; obj.value = decodeURIComponent(encoded.replace(/\+/g, " ")); }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.