Answers for "url encode = js"

9

urlencode javascript

var url = encodeURIComponent('url');
Posted by: Guest on March-27-2021
0

Encode URL in JavaScript?

Check out the built-in function encodeURIComponent(str) and encodeURI(str).
In your case, this should work:

var myOtherUrl = 
       "http://example.com/index.html?url=" + encodeURIComponent(myUrl);
Posted by: Guest on March-15-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language