当前位置:Gxlcms > PHP教程 > ajax获取到的id数据,怎么通过post方式提交该数据到post页面去

ajax获取到的id数据,怎么通过post方式提交该数据到post页面去

时间:2021-07-01 10:21:17 帮助过:30人阅读

ajax获取到的id数据,如何通过post方式提交该数据到post页面去。
ajax获取到的id数据,如何通过post方式提交该数据到post页面去。



比如这样子的,如果id=“abc”里面显示的是:我们和你。。。
请问如何才能把我们和你这个值通过post方式提交给test.php处理页面去活得这个值

分享到:


------解决方案--------------------
百度一下,ajax post请求很多的,我一般都是用jquery的ajax 很方便

$.ajax({
'type': 'POST',
'url':"createurl('ctrain')?>",
'cache': false,
'dataType' :"html",
'data':{"id":id},
'success': function(data) {
//data是返回的结果
$("#BgDiv").show();
$("#show_data").append(data);
}
});

人气教程排行