【发布时间】:2012-03-26 03:15:22
【问题描述】:
我正在生成这样的消息
$msg({to: 'user', from: 'me', type: 'chat'}).c("body").t('some data');
生成:
<message to='user' from='me' type='chat' xmlns='jabber:client'>
<body>some data</body>
</message>
但我需要这个:
<message to='user' from='me' type='chat' xmlns='jabber:client'>
<body><![CDATA[some data]]></body>
</message>
strophejs 有东西还是我需要自己生成它们?甚至可以将 CDATA 发送到 XMPP 吗?
【问题讨论】:
-
为什么需要它是 CDATA?
-
数据可以是 xml 或 json 所以我想我需要那个
标签: javascript xml xmpp strophe