前端Jq 简单的Ajax请求

        function getAjax(){
        	var a = 'abc';
        	var b = '12';
        	$.ajax({
            	type: "GET", //GET 或 POST
            	url: "http://www.a.com", //请求地址
            	data: {name:a,age:b}, //传输的数据参数
            	dataType: "json",
             	success: function(data){
                	console.log(data);      
             	}
         	});
        }

猜你喜欢

转载自blog.csdn.net/qq_24909089/article/details/80480213