title: how to add php to javascript that is within php
body: <p>I have a page of PHP code. </p>
  
  <p>I have then added facebook comments in javascript:</p>
  
  <pre><code>$output = '&lt;div id="fb-root"&gt; ... &lt;/div&gt;';
  </code></pre>
  
  <p>WITHIN this <code>$output</code> I would like to add a call to a PHP function <code>drupal_mail()</code>.</p>
  
  <p>The code looks like: </p>
  
  <pre><code>$output = '&lt;div id="fb-root"&gt; ....
  FB.Event.subscribe("comment.create", function (response) {
  '. drupal_mail("facebook_comments", "notify", "xxx.com",               user_preferred_language($user), $params); .  '
  &lt;/div&gt;';
  </code></pre>
  
  <p>but I'm getting a <code>Parse error: syntax error, unexpected '.'</code> </p>
  
  <p>How do I add the <code>drupal_mail()</code> function?</p>