title: Encoding URL in JavaScript
body: <p>I'm unable to encoding data URI:</p>
  
  <pre><code>var uri ="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQo...";
  var res = encodeURI(uri);
  document.location.href = 'display.jsp?img='+res;
  </code></pre>
  
  <p>After encoding, I'm getting the same uri. <code>display.jsp</code> is landing as am empty page.</p>