encodeURI:
encodeURIComponent:
- encodeURI() encodes an entire URL while preserving common characters and reserved URL characters such as"; / ? : @ & = + $ , #". Other characters are encoded as UTF-8 bytes, each prefixed with %.
- encodeURIComponent() encodes an individual URL component. Reserved characters such as"; / ? : @ & = + $ , #"are encoded too. Both functions use UTF-8 percent encoding.