//ajax选择获取相应的数据
$.ajax({
type:'post',
url:'http://81.68.93.235:8181/api/chickensoup/list',
contentType:'application/json',
beforeSend:function(){
alert('请求即将发送');
},
success:function(response){
//判断是否连接成功
if(response.code == 200){
//调用接口,根据输入的id,返回需要的数据
alert(JSON.stringify(response.data[parseInt($("#id").val())-1]));
}
if(response.code == 400){
alert("错误!");
}
},
error:function(xhr){
alert("失败");
}
});



