js encodeURIComponent replace spaces code example Example: type script encode url var encodeURI = encodeURIComponent("&")