title: Syntax Error when calling a JavaScript function
body: <p>When I click on a table cell, i want my program to run a function whilst passing the parameter <code>$venues[$y][1]</code> through. However, whenever i click on a cell, i get the error:</p>
  
  <pre><code>SyntaxError: expected expression, got '}'
  </code></pre>
  
  <p>Here is the function which gets called:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function displayPicture(x){
      alert(x);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Here is the line that calls the function (its html and php):</p>
  
  <pre><code>echo '&lt;td class="venueNames" onclick="displayPicture("'.$venues[$y][1].'")"&gt;'.$venues[$y][1].'&lt;/td&gt;';
  </code></pre>
  
  <p>For the sake of this example, lets assume <code>$venues[$y][1]</code> is Wembley.</p>
  
  <p>Is the issue because I am passing a php variable as a parameter for a javascript function?</p>