Strip slashes that jQuery adds when returning HTML via ajax? -


i using jquery ajax method data database , return data via json object. 1 of values in json object html string. doing seen here except need know how can remove slashes jquery adding html string. ideas?

example

json.html = click <a href=\"http://example.com/example.php\">here</a>;  //needs json.html = click <a href="http://example.com/example.php">here</a>; 

i hoping without code if possible.

update

ok found if htmlentites before returned, slashes not there when value comes in. now, jquery function use insert string inside td element without slashes being added .html or .text functions.

here looks directly json.html value,

click &lt;a href=\&quot;http://example.com\&quot;&gt;here&lt;/a&gt; 

and here after displayed using .html

click <a href=\"http://example.com\">here</a> 

and here after displayed using .text

click &lt;a href=\&quot;http://example.com\&quot;&gt;here&lt;/a&gt; 

i wonder if need use .val maybe? oh 1 more thing, want html display literally, not actual html inserted code.

could simple as:

stringvar.replace('\\',''); 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -