Skip to content

Instantly share code, notes, and snippets.

@ktkr3d
Created October 29, 2021 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktkr3d/30d5d2101688434a7c809c110743bb48 to your computer and use it in GitHub Desktop.
Save ktkr3d/30d5d2101688434a7c809c110743bb48 to your computer and use it in GitHub Desktop.
Encode / Decode URI
<html>
<head>
<title></title>
</head>
<body>
<form name="f01">
<div>
<textarea name="ta01" rows="3" placeholder="Input encoded URI!" style="width:60%"></textarea>
<input type="button" value="decodeURI" onclick="document.f01.ta02.value=decodeURI(document.f01.ta01.value)" />
<input type="button" id="btn02" value="copy" />
<script type="text/javascript">
document.f01.btn02.addEventListener("click", function(event) {
event.preventDefault();
document.f01.ta01.select();
document.execCommand("copy");
});
</script>
</div>
<div>
<textarea name="ta02" rows="3" placeholder="Input decoded URI!" style="width:60%;"></textarea>
<input type="button" value="encodeURI" onclick="document.f01.ta01.value=encodeURI(document.f01.ta02.value)" />
<input type="button" id="btn04" value="copy" />
<script type="text/javascript">
document.f01.btn04.addEventListener("click", function(event) {
event.preventDefault();
document.f01.ta02.select();
document.execCommand("copy");
});
</script>
</div>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment