Answers for "js encode url online"

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