title: How to echo $username variable into a javascript
body: <p>I was wondering if there is a way to display or echo a <code>$username</code> variable within a javascript function that display an html string. This is the original function:</p>
  
  <pre><code>    Plugin.prototype.counter = function() {
      if (this.s.counter) {
      $(this.s.appendCounterTo).append('&lt;div id="counter"&gt;&lt;span id="counter-current"&gt;' 
          + (parseInt(this.index, 10) + 1) + '&lt;/span&gt; / &lt;span id="counter-all"&gt;' 
          + this.$items.length 
          + '&lt;/span&gt;&lt;a href="index.htm"&gt;&lt;sig&gt; JOHN SMITH &lt;/sig&gt;&lt;img src="jOHN.png"&gt;&lt;/a&gt;&lt;/div&gt;');
      }
  };
  </code></pre>
  
  <p>I've tried inserting this:  </p>
  
  <pre><code>    &lt;?php $arrays = file_get_contents('username.txt'); echo $arrays;?&gt;
  </code></pre>
  
  <p>Instead of <code>JOHN SMITH</code>, with and without quotes... Not working.</p>
  
  <p>Any idea how to do such task?</p>