Javascript how to escape characters
<p>I want to insert some html into a div suppose this:</p>

<pre><code>&lt;div id="Sag"&gt;
 &lt;/div&gt;
</code></pre>

<p>I am using <code>$('#Sag').html(data)</code>, in order to insert data into this div...
but here is the problem my data is:</p>

<pre><code>&lt;table style="direction: rtl;float:right;"&gt;
                    &lt;?php $sess = isset(Yii::app()-&gt;session['cart']) ? Yii::app()-&gt;session['cart'] : '{}';
                        $ses = json_decode($sess, true);
                        foreach ($ses as $i=&gt;$value11){
                        ?&gt;
                &lt;tr style="direction: rtl;" class="cart_show"&gt;
                     &lt;td&gt;
                         &lt;img class="picCart-&lt;?php echo $i; ?&gt;" src="&lt;?php echo Yii::app()-&gt;request-&gt;baseUrl."/images/".$ses[$i]['properties']['pic_directory'];?&gt;" width="100" heigh="100"&gt;
                     &lt;/td&gt;
                    &lt;td class="descCart-&lt;?php echo $i; ?&gt;"&gt;
                        &lt;?php echo $ses[$i]['properties']['description'];?&gt;
                    &lt;/td&gt;
                    &lt;td class="priceCart-&lt;?php echo $i; ?&gt;"&gt;
                        &lt;?php echo $ses[$i]['properties']['price'];?&gt;
                    &lt;/td&gt;
                    &lt;td class="quantityCart-&lt;?php echo $i; ?&gt;"&gt;
                        &lt;input type="text" style="width: 20px;" class="voroodi" value="&lt;?php  
                        echo $ses[$i]['quantity'];
                        ?&gt;"&gt;
                        &lt;button name="delete_from_cart-&lt;?php echo $i; ?&gt;" class="btnDel"&gt;??? &lt;/button&gt;
                        &lt;button name="modify_cart-&lt;?php echo $i; ?&gt;" class="btnModify"&gt;?????&lt;/button&gt;
                    &lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;?php } ?&gt;
                        &lt;/table&gt;    
</code></pre>

<p>so how can I escape <code>"</code>,<code>'</code>, ...? should I use a <code>\</code> before each one, or is there something like <code>@</code> in C# to use in javascript?</p>
