how to encode & in url javascript code example Example: urlencode javascript var url = encodeURIComponent('url');