我想在 div 中插入一些 html 假设:
<div id="Sag">
</div>
我在用$('#Sag').html(data)
,为了将数据插入到该 div 中...
但这是我的数据的问题:
<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>
那我该如何逃脱"
,'
, ...?我应该使用\
在每个之前,或者有类似的东西@
在C#中使用javascript?
那么我怎样才能转义“,”,...我应该在每个之前使用\,还是在c#中是否有像@这样的东西可以在javascript中使用
不,JavaScript 没有与 C# 相当的功能@
特征。
在 JavaScript 中,字符串可以用单个 ('
) 或双 ("
) 引号。在引用中,仅需要转义用于引用的样式。因此,在用单引号引起来的字符串中,双引号不需要转义;在使用双引号的字符串中,单引号不需要转义。 (总是如此okay为了逃避他们,唯一不同的是你是否have to.)
因此,您通常会选择最少使用的一个,并将其用作主字符串的分隔符。例如。:
str = "This uses doubles, so I don't have to worry about the ' in \"don't\".";
请注意,我不必逃避'
在那里,但我必须逃离"
.
相似地:
str = 'This uses singles, so I don\'t have to worry about "quoting" things.';
在那里我不得不逃离'
但不是"
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)