Showing text with single quotes and/or double quotes
<p>I have a variable of text, that can have  single quotes or doubles quotes. For example in some cases.</p>

<pre><code>`Estado 'mayor`' or  Esto dijo: "Ayer".
</code></pre>

<p>This text in some cases is taken from a Json, or a variable from database through .spring mvc. </p>

<p>I tried with this:</p>

<pre><code>             try{
            descrp='${dataProvider.description}';
        }
        catch(err){
            descrp="${dataProvider.description}";
        }
</code></pre>

<p>but i have Uncaught SyntaxError: Unexpected identifier </p>

<p>And with:</p>

<pre><code>            try {
            alert(data.description);
            }
            catch(err){
             alert(data.description.replace("'", "\'"));    
            }
</code></pre>

<p>the same error.
Is possible to do something for both cases? (singles quotes and doubles quotes)</p>
