Recent 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);

No comments:

Post a Comment