title: JavaScript parse variable in quote
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3304014/javascript-variable-inside-string-without-concatenation-like-php">JavaScript Variable inside string without concatenation - like PHP</a>  </p>
  </blockquote>
  
  
  
  <p>In PHP, double quotes has the ability to read variable, e.g.</p>
  
  <pre><code>"$foo"
  </code></pre>
  
  <p>But in JavaScript, you have to always use a <code>+</code> to read a variable so that the variable won't be inside the quote when it is read, e.g.</p>
  
  <pre><code>var foo='bar';
  alert("The name's "+foo);
  </code></pre>
  
  <p>So, is there any workaround or method to do this? Using <code>+</code> all the time is quite troublesome.</p>