Apostrophes in jquery/javascript string
<p>I have the following code which appends an icon with an alert after the <code>&lt;a&gt;</code> tag :</p>

<pre><code>$j("li[name='"+node_name+"'] &gt; a").after('&lt;a onmouseover="alert(\' expnote_from_db[n][0] \');" &gt;&lt;ins class="' + selected_class + '"&gt;&amp;nbsp;&lt;/ins&gt;&lt;/a&gt;');
</code></pre>

<p>The code above works fine except that it displays <code>exp_from_db[n][0]</code> as a string inside the alert box.</p>

<p>So I changed it to the code below but nothing is displayed now</p>

<pre><code>  $j("li[name='"+node_name+"'] &gt; a").after('&lt;a onmouseover="alert(\'"'+ expnote_from_db[n][0] + '"\');" &gt;&lt;ins class="' + selected_class + '"&gt;&amp;nbsp;&lt;/ins&gt;&lt;/a&gt;');
</code></pre>

<p>I don't understand where did I go wrong with the apostrophes.</p>

<p>I would appreciate your help regarding this. Thanks</p>
