大哥们,碰到个ajax传值传不到后台的问题
php吧
全部回复
仅看楼主
level 2
$(function () {
$("#login").click(function () {
$.ajax({
url:"{:url('admin/index/login')}",
type:"post",
data:$('from').serialize(),
dataType:"json",
success:function (data) {
console.log(data);
}
});
return false;
});
});
这是我的ajax传值,但是传不到后台很头大
2019年11月05日 14点11分 1
level 2
2019年11月05日 14点11分 2
这是我的路由定义
2019年11月05日 14点11分
level 2
还有有哪个师傅收人吗,现在刚开始自学tp框架
2019年11月05日 14点11分 3
level 2
2019年11月05日 14点11分 5
这是f12的信息
2019年11月05日 14点11分
level 7
data传的明显错误的,给form一个id吧或者名字
2019年11月05日 14点11分 6
id=“myform” data:$("#myform").serialize();改成这样还是没有传出去
2019年11月05日 15点11分
level 9
console一下serialize()里都有什么东西
2019年11月05日 15点11分 7
怎么打印,我以前没接触过js,现在也是临时扫了ajax的内容
2019年11月05日 15点11分
搞定了
2019年11月06日 15点11分
2022年03月11日 15点03分
可以贴个代码吗?
2022年03月11日 15点03分
level 9
前端代码贴出来啥,有可能是你的input没有name属性
2019年11月06日 01点11分 8
有写,可以传值了,是我data那选择器选择的值写错了
2019年11月06日 15点11分
level 11
直接看浏览器的xhr请求
2022年03月11日 19点03分 11
XHR没有东西呀
2022年03月12日 02点03分
@no20167337 这里是可以看到数据的,你也可以console.log
2022年03月12日 12点03分
1