title: How to pass 2 JavaScript variables through a url?
body: <p>I am trying to have 2 variable values passed in a url, which url will be redirected after. How can I insert them in a JavaScript string? </p>
  
  <p>I have:</p>
  
  <pre><code>var a = document.getElementById("username_a").value;
  var b = document.getElementById("username_b").value;
  </code></pre>
  
  <p>and want something like:   <code>var string_url = "http://www.example.com/?{a}blabla={b}"</code> and then redirect somehow.</p>
  
  <p>In PHP I would go with that code for example: <code>&lt;iframe src="http://www.example.com?query=&lt;?php echo $the_variable;?&gt;"&gt;
  </code></p>