title: Passing variable to javascript from html with spaces
body: <p>How can I pass a string variable from HTML to javascript with spaces?</p>
  
  <p>For instance, I have the following:</p>
  
  <pre><code> &lt;a data-toggle="tab" data-productname="Testing Name"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>When I access the productname attribute in javascript, only "Testing" shows up. I tried to escape the variable with:</p>
  
  <pre><code> &lt;a data-toggle="tab" data-productname=&lt;%= j "Testing Name" %&gt;&gt;&lt;/a&gt;
  </code></pre>
  
  <p>But that still doesn't work. What can I do here?</p>