i can't append selector image with jquery inside my custom block

Permalink
here my code

<?php defined('C5_EXECUTE') or die(_("Access Denied."));
$al = Loader::helper('concrete/asset_library');
?>
<script>
   $("#btn_add").click(function(){
      $("#adding").append(<?php echo $al->image('ccm-b-file', 'fID[]', t('Choose File'), $bf); ?>);
   });
</script>
<?php echo $al->image('ccm-b-file', 'fID[]', t('Choose File'), $bf); ?>
<?php $bf = null; ?>
<input type="button" id="btn_add" value="add" />
<?php echo $al->image('ccm-b-file2', 'fID2', t('Choose File'), $bf2); ?>
<?php $bf2 = null; ?>
<div id="adding">
</div>


i don't understand why i cannot append a image selector with jquery i can append text or any variable but when try with selector nothing any help would be appreciate or any other solution

 
JohntheFish replied on at Permalink Reply
JohntheFish
Rather than try and create it on the fly, create the selector with php in a hidden div element, then show that element with jQuery.