开发者

jQuery ajax call: " turns out \"

开发者 https://www.devze.com 2023-01-17 04:27 出处:网络
Hey, i noticed when my ajax response (msg) gets prepended and toggled, if it contains \" or \' it turns out \\\" and \\\'.

Hey, i noticed when my ajax response (msg) gets prepended and toggled, if it contains " or ' it turns out \" and \'.

How can 开发者_高级运维i fix this?


Show us your server side code.

but it looks like your using addslashes on the content before your sending it.

for example

$string = "I love biscuit's";

$string = addslashes($string); //I love biscuit\'s

//now its slashed, remove them
$string = stripslashes($string); // I love biscuit's
0

精彩评论

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