title: JavaScript escape characters coming from PHP
body: <p>I'm having the simple script as follows,</p>
  
  <pre><code>&lt;?php
  
  $actionbutton = '&lt;input type="button" onclick="document.location.href=\'/backoffice_dev.php/currency/edit/EUR\';" value="Edit"&gt;';
  $tr = '&lt;tr&gt;&lt;td&gt;'.$addNewCurrencyPOST["id"].'&lt;/td&gt;
  &lt;td&gt;&lt;div class="led on"&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td&gt;'.$addNewCurrencyPOST["symbol"].'&lt;/td&gt;
  &lt;td&gt;'.$addNewCurrencyPOST["symbolhtml"].'&lt;/td&gt;
  &lt;td&gt;'.$addNewCurrencyPOST["usdrate"].'&lt;/td&gt;
  &lt;td&gt;'.$addNewCurrencyPOST["eurrate"].'&lt;/td&gt;
  &lt;td&gt;'.$actionbutton.'&lt;/td&gt;&lt;/tr&gt;';
  
  ?&gt;
  
  &lt;script&gt;
      var tr = "&lt;?php echo $tr ?&gt;";
      console.log(tr);
  &lt;/script&gt;
  </code></pre>
  
  <p>But it is throwing a error "Uncaught SyntaxError: Unexpected token ILLEGAL " in chrome. Note that there is no special characters in any of the values coming from PHP. I'm using prototype JS in this page. Is it causing this problem? Because i don't have any knowledge on that. </p>
  
  <p>And how to append this to a table without using <code>insertRow</code> and <code>insertCell</code> functions? Please help guys..</p>