开发者

Unescaping of data in JS

Say i got a variable,

var s = "\"\\\"abc\\\"\"";

which is unescaped to "\"abc\"" when i display in the browser.

But i need it to be开发者_Go百科 further unescaped to the actual value "abc".


You can, but probably shouldn't, call eval:

s = eval(s);

However, this is extremely dangerous.

For a safer solution, please provide more detail.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜