Ajax请求

127 阅读1分钟

ajax请求:

	$.ajax({
    	//请求的后台程序的地址
    	"url":"ajax.php",
        //发送到后台的数据
        "data":fd,
        //请求的方式
        “type”:"post",
        //设置返回值的类型
        "dataType":"text"
        //当使用FormData对象时,要设置下面两个配置为false
        "contentType":false,
        "processData":false,
        //readyState==4时的回调函数,参数是后台返回的数据
       	"success":function(msg){
        	console.log(msg);
        }
    })