Hello again,
Adding some jQuery to my projects I found a little "bug?" (I dont know if call it bug, cause all works perfects, but the resultant html have an extra character:
Let me dhow this:
In my view:
<div id="myDiv"> </div> <?php echo CHtml::button('Add some', array('id'=>'addSome')); ?> <?php Yii::app()->clientScript->registerScript('scriptAddSome','$("#addSome").click(function () { $("#myDiv").append("<strong>Some</strong>"); });',CClientScript::POS_READY); ?>
The registered script is the following:
<script type="text/javascript">
/<![CDATA[/
jQuery(document).ready(function() {
$("#addSome").click(function () {
$("#lmyDiv").append("<strong class='bbc'><span style='color: red'>></span></strong><strong>some</strong>");
});
});
/]]>/
</script>
Note the added >
But if in the append I put no html (e.g. just plain text), nothing is added…