jQuery alerts and escaping quotes
<p>I have a php page on which I show a jQuery alert when a user adds products to their cart. The message displayed in the alert is a variable from a php page where all language elements are stored.</p>

<pre><code>$cartaddeditem='The product was added to your cart.\r\n You can view your &lt;a href=\'cart.php?action=show\'&gt;shopping cart&lt;/a&gt; or click OK to continue shopping';
</code></pre>

<p>Then, on the page:</p>

<pre><code>&lt;body onload="jAlert('success', '&lt;?=$cartaddeditem?&gt;', '&lt;?=$minicart?&gt;');" &lt;? } &gt;
</code></pre>

<p>The problem is that the alert fails to fire because of the quotes in the $cartaddeditem var and I'm getting an error in firebug that says:</p>

<pre><code>Error: missing ) after argument list
Line: 1, Column: 22
Source Code:
jAlert('success', The product was added to your cart.\r\n You can view your &lt;a href=\
</code></pre>

<p>How do I escape the quote in the message string for jQuery? I tried several escaping types with double and single quotes, one or two backslashes but nothing worked.</p>
