咨询电话:
15628812133
07
2018/07

怎样实现ajax与php数据的交互并局部刷新页面?

发布时间:2018-07-07 10:07:55
发布者:liyongxing
浏览量:
0

ajax基本语法

$.ajax({
    type: "post",  //数据的提交方式(post\get)
    url: "text.php",  //提交的url地址
    data: {name:name,pwd:pwd},//需要提交的数据
    dataType: "json",//返回的数据类型格式
    success: function(msg){      //返回成功的回调函数
    },
    error:function(msg){      //返回失败的回调函数
    }
});

php端的接收方法

html端代码text.html


  
  ajaxTest
    
    
    
    

php端代码text.php

在text.html中加入以下js代码

关键词:
返回列表