title: Uncaught SyntaxError: Unexpected identifier
body: <p>hello im am getting JS error :</p>
  
  <pre><code> Uncaught SyntaxError: Unexpected identifier
  </code></pre>
  
  <p>here </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var cur_level = 1;
  var ids_arr = new Array(&lt;?php echo $max_level?&gt;);
  var im_here = new Array(&lt;?php echo $max_level?&gt;);
  ids_arr[0] = 1;
  im_here[0] = "|";
  function displayData(id, level, used, title)
  {
  if(used){
      choice = document.getElementById('divv'+id).innerHTML;
      document.getElementById('test_div').innerHTML = choice;
  
  } else {
      document.getElementById('test_div').innerHTML = ' No lerning paths to show.';
      updateLinksDiv(id, level, title);
  
    }
  }
  
  function updateLinksDiv(id, level, title)
  {
  var links_div_info = document.getElementById('links_parent_'+id);
  var tmpHTML = '';
  var here = '';
  
  for(i=0;i&lt;level;i++){
      here+= '-&gt;'+im_here[i];
      links_div_info = document.getElementById('links_parent_'+ids_arr[i]);
      tmpHTML += '&lt;div id="divl_'+links_div_info.id+'"&gt;'+links_div_info.innerHTML+'&lt;/div&gt;';
  }
  links_div_info = document.getElementById('links_parent_'+id);
  tmpHTML += '&lt;div id="divl_'+links_div_info.id+'"&gt;'+links_div_info.innerHTML+'&lt;/div&gt;';
  
  document.getElementById('links').innerHTML = tmpHTML;
  ids_arr[i] = id;
  im_here[i] = title;
  }
  
  &lt;/script&gt;
  
  
  &lt;script type="text/javascript"&gt;
      window.onload=updateLinksDiv(1 , 0 , "|" ) ;
  &lt;/script&gt;
  </code></pre>
  
  <p>the functions are suppose to create an "expanding" that opens up with levels and everything was working fine untill i added the "title" and i started getting the error.
  the error points me to the last  and i just cant find the error... 
  i try to call displayData like this </p>
  
  <pre><code>onclick="displayData('.$cat-&gt;id.','.$cat-&gt;level.',0,'.$cat-&gt;title.')"
  </code></pre>
  
  <p>any suggestions for what i'm not seeing.?</p>
  
  <p>thank you</p>