JavaScript: Online unescape/decodeURIComponent Function

A simple usage of the unescape/decodeURIComponent() “obfuscation” function in JavaScript…

Disclaimer

This will not work anymore as the wordpress.com is a commercial sh1t3 that does not allow that… I know, it’s for free, but I mean the unsolicited advertisements do bring money, don’t they? Whatever…

Source Code

Apparently, it could have been written in a optimized and shortened way, but this is more obvious…

Note: The unescape() function was deprecated in JavaScript version 1.5. Use decodeURIComponent() instead …

JavaScript code:

function unescp(){
document.getElementById('unescres').value = decodeURIComponent(document.getElementById('unescin').value);
}

function escp(){
document.getElementById('escres').value = encodeURIComponent(document.getElementById('escin').value);
}

HTML code:

Escaped input:<input type="text" id="unescin" oninput="unescp();" />
Unescaped result:<input type="text" id="unescres" />

Unescaped input:<input type="text" id="escin" oninput="escp();" />
Escaped result:<input type="text" id="escres" />

Advertisements
This entry was posted in Browser, Security, Server and tagged , . Bookmark the permalink.