I'm having the simple script as follows,
<?php
$actionbutton = '<input type="button" onclick="document.location.href=\'/backoffice_dev.php/currency/edit/EUR\';" value="Edit">';
$tr = '<tr><td>'.$addNewCurrencyPOST["id"].'</td>
<td><div class="led on"></div></td>
<td>'.$addNewCurrencyPOST["symbol"].'</td>
<td>'.$addNewCurrencyPOST["symbolhtml"].'</td>
<td>'.$addNewCurrencyPOST["usdrate"].'</td>
<td>'.$addNewCurrencyPOST["eurrate"].'</td>
<td>'.$actionbutton.'</td></tr>';
?>
<script>
var tr = "<?php echo $tr ?>";
console.log(tr);
</script>
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.
And how to append this to a table without using insertRow
and insertCell
functions? Please help guys..