Recent Posts

Showing posts with label encodeURIComponent. Show all posts
Showing posts with label encodeURIComponent. Show all posts

Encoding URL with JavaScript

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

var myOtherUrl = 
       "http://example.com/index.html?url=" + encodeURIComponent(myUrl);