I am wanting to append a div with an html string. However I also need to include jquery for that div to use where it is appended to. The append function is readying the jquery instead of just using it as a string.
In php you cancel out such events with a back space. Is there a way to do the same??
Some example code
PHP Code:
<script>
$("#addNow_{$row['id_item']}").click(function () {
$("#holder_{$row['id_item']}").append("$data");
});
</script>
$data that works includes
PHP Code:
<div id="holder_{$row['id_item']}\"><!-- Product group holder --><div id=\"iten_content\">TEST</div></div>
However when attempting to include the below as part of $data it fails, and I believe the cause it is taking the jquery string literally as oppose to as a string.
PHP Code:
$("#delete_{$row['id_item']}\").click(function () {
$(\"#holder_{$row['id_item']}\").remove();
});
Any help much appreciated!