JavaScript cómo escapar de los personajes
Quiero insertar algunos html en un div supongamos esto:
<div id="Sag">
</div>
Estoy usando$('#Sag').html(data)
, para insertar datos en este div ... pero aquí está el problema, mis datos son:
<table style="direction: rtl;float:right;">
<?php $sess = isset(Yii::app()->session['cart']) ? Yii::app()->session['cart'] : '{}';
$ses = json_decode($sess, true);
foreach ($ses as $i=>$value11){
?>
<tr style="direction: rtl;" class="cart_show">
<td>
<img class="picCart-<?php echo $i; ?>" src="<?php echo Yii::app()->request->baseUrl."/images/".$ses[$i]['properties']['pic_directory'];?>" width="100" heigh="100">
</td>
<td class="descCart-<?php echo $i; ?>">
<?php echo $ses[$i]['properties']['description'];?>
</td>
<td class="priceCart-<?php echo $i; ?>">
<?php echo $ses[$i]['properties']['price'];?>
</td>
<td class="quantityCart-<?php echo $i; ?>">
<input type="text" style="width: 20px;" class="voroodi" value="<?php
echo $ses[$i]['quantity'];
?>">
<button name="delete_from_cart-<?php echo $i; ?>" class="btnDel">??? </button>
<button name="modify_cart-<?php echo $i; ?>" class="btnModify">?????</button>
</td>
</tr>
<?php } ?>
</table>
so, ¿cómo puedo escapar"
,'
, ...? debería usar una\
antes de cada uno, o hay algo como@
en C # para usar en javascript?