title: Quotes in Javascript
body: <p>I have been trying for hours to fix this code, I can't see what's wrong:</p>
  
  <pre><code>document.getElementById('detail'+num).innerHTML='&lt;a class="dobpicker" href="javascript:NewCal('+s_d+','+ddmmyy+')"&gt;'
  </code></pre>
  
  <p>The problem is in href="javascript ..."
  s_d is a javascript variable defined as </p>
  
  <pre><code>var num = 2;
  var s_d = "sname"+num;
  var ddmmyy = "ddmmyy";
  </code></pre>
  
  <p>Basically I need to call a javascript function with different parameter each time. </p>