decodeURI() and encodeURI()?EncodeURI() is used to convert URL into their hex coding. And DecodeURI() is used to convert the encoded URL back to normal.<script>
var url="my test.php?name=volkswagen&car=polo";
document.write(encodeURI(url)+ "<br>");
document.write(decodeURI(url));
</script>
my%20test.php?name=volkswagen&car=polo
my test.php?name=volkswagen&car=polo