lzh900926

<input type="text" id="txt1" cols="80" rows="3" />  //首先建立text,用来显示后端解析好的数据

<center><input type="button" id="button1" value="查询" /></center> //建立一个按钮 用来查询数据库并返回数据

<script>  //开始 AJAX显示代码
$("#button1").click(function(){   //取得按钮的ID 并在点击时触发函数

$.post("baojing.php",function(result){  //$.post("url(就是要连接的php)","{(参数)}","回调函数"{函数})

$("#txt1").attr("value",result);//用attr就是返回到被选标签value的值


});



})

这个就是AJAX全部内容 ,当时在PHP文件中用if $(isset("#button")){查询数据库,解析什么的...}但是 不用前面已经说的很清楚了  当点击时 POST到php页面  !!!

分类:

技术点:

相关文章:

  • 2021-09-26
  • 2021-07-29
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-12-15
  • 2021-09-06
猜你喜欢
  • 2021-11-07
  • 2021-09-26
  • 2021-08-05
  • 2021-11-26
  • 2021-12-06
  • 2021-06-08
  • 2021-12-29
相关资源
相似解决方案