How Can We Help?
There are two JavaScript function that you can use to accomplish this
- encodeURIComponent()
- Encodes a URI component
- Encodes special characters
- The following characters: , / ? : @ & = + $ # are encoded
var url="http://test.com/index.php?url"+encodeURIComponent(url);
- encodeURI()
- Encode a URI
- Encodes special characters but not (except) , / ? : @ & = + $ #
var url="http://test.com/index.php?url"+encodeURI(url);