title: Passing variables to URL with clicking on image - JavaScript
body: <p>When clicking on image which is also link to login page with login form, I would like to pass my username. Clicking on image it redirects user to login page and in username field automatically places username which was passed there trough URL so user has to write only password and click button to login.</p>
  
  <p>I was thinking maybe something like this:</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  var scrt_var = {{contact.username}} 
  &lt;/script&gt;
  
  &lt;a href="https://{{contact.image_bank_url}}" onclick="location.href=this.href+'?key='+scrt_var;return false;"&gt;&lt;img src="http://image.png"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>And this is my username field in login form:</p>
  
  <pre><code>&lt;input id="id_username" name="username" type="text"&gt;
  </code></pre>
  
  <p>Is there maybe other way to do it?</p>