php文件
send.php
function send.php(){
if(异常){
echo "错误信息";
} else {
//业务处理区域
echo json_encode(结果集);
}
}
js处理页面
function Sendreception(id){
$.ajax({
'type': 'GET',
'url': "send.hpp",
'cache': false,
'dataType' :"html",
'data':{"id":id},
'success': function(data) {
try{
var list = JSON.parse(data);
//处理代码
}catch(exception){
alert(data);
return;
}
}
});
}
send.php
function send.php(){
if(异常){
echo "错误信息";
} else {
//业务处理区域
echo json_encode(结果集);
}
}
js处理页面
function Sendreception(id){
$.ajax({
'type': 'GET',
'url': "send.hpp",
'cache': false,
'dataType' :"html",
'data':{"id":id},
'success': function(data) {
try{
var list = JSON.parse(data);
//处理代码
}catch(exception){
alert(data);
return;
}
}
});
}