$.post('/home/?r=login/doLogin',{user:user,passwd:passwd},function(res){})
解决方法
$.post添加第四个参数
$.post('/home/?r=login/doLogin',{user:user,passwd:passwd},function(res){},'json')
使用$.post发送JSON数据
本文介绍了一种改进的方法来使用jQuery的$.post函数发送JSON数据。通过指定数据类型为'json',确保了服务器能够正确地接收和解析传入的数据。
$.post('/home/?r=login/doLogin',{user:user,passwd:passwd},function(res){})
解决方法
$.post添加第四个参数
$.post('/home/?r=login/doLogin',{user:user,passwd:passwd},function(res){},'json')

被折叠的 条评论
为什么被折叠?