问题"&安培;"使用Ajax时将数据发布到PHP签署

问题描述:

我使用TinyMCE的是我的编辑。 一切都很好用发送内容保存在数据库或回声出来。但是,当一个&符号&放大器;来了,在那之后截断的所有数据,并且不保存在数据库或回声出 我该怎么办。在这里,我有文件,它只有1KB,请下载,运行它 谢谢大家。

i use tinyMce as my editor. everything is fine with sending content to save in database or echo it out. but when an ampersand sign "&" comes , all data after that truncated and dont save in database or echo out what should i do. here i have file , it's only 1kb, please download it, run it thank you everyone.

下载文件

请,如果你能罚的方式来摆脱&放大器;签署告诉我和其他人...。

please if you could fine a way to get rid of "&" sign tell me and others how... .

这个问题肯定是在JS。你应该使用EN codeURIComponent()发送urlen codeD信息。在

the problem is surely in the js. you should use encodeURIComponent() to send urlencoded information. as in

var parameters = 'message='+encodeURIComponent(message);

EN codeURIComponent()上W3Schools的