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 <a href=\"http://example.com\">here</a>
and here after displayed using .html
click <a href=\"http://example.com\">here</a>
and here after displayed using .text
click <a href=\"http://example.com\">here</a>
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
Post a Comment