注册

ajax 调用rest 用户注册报错

我的项目采用开放注册模式
html 通过jquery+ajax的方式调用 但总是报错 已经整了一天了 希望能有人能帮助我下 看下我哪里写错了

无标题.png



这是我的调用方法




报错如下:是报json格式错误

已邀请:

lizg - ……

data需要转换一下JSON.stringify(a)
> forum.php?mod=redirect&goto=findpost&pid=1507&ptid=768
data需要转换一下JSON.stringify(a)


不是很明白你的意思 能给个范例吗?劳驾
谢谢1L的提示 已解决 虽然不是很明白为什么 修改成这样就成功了


var d = { username: "olina", password: "1112321"}
$.ajax({
type: 'post',
contentType: 'application/json',
dataType: 'json',
async: false,
url: 'https://a1.easemob.com/**xx/**X/users',
data: JSON.stringify(d),

success: function (data) {
alert("success:" + data);

},
error: function (data) {
alert("error:" + data);
}
});

lizg - ……

试试附件的修改是否可以
经验啊... 向楼主学习











static/image/common/sigline.gif
90%打工小伙一生都不可能知道的秘密http://user.qzone.qq.com/82175487

要回复问题请先登录注册