js部分:
function onck(xyz){
confia("__URL__/getCode_group/cond/"+xyz);
}
//ajax发出请求
function confia(actionurl){
jQuery.ajax({
url: actionurl,//提交访问的URL
type: 'POST',//提交的方法
dataType: 'html',//返回的内容的类型,由于PHP文件是直接echo的,那么这里就是text
timeout: 1000,//超时时间
error: function(){ //如果出错,执行函数
},
success: function(data)
{
resu(data,"1");
}
});
}//ajax返回数据
function resu(data,status)
{
alert(data);//在这里怎么获取不到ajax返回的数据?????
}php后台代码:
function getCode_group(){
$db = Db::getInstance();
$cond=$_REQUEST['cond'];
$str="select * from info_codedtl where code_no='".$cond."' AND code_type='AST18'";
$listr=$db->query($str);
echo json_encode($listr);
}
function onck(xyz){
confia("__URL__/getCode_group/cond/"+xyz);
}
//ajax发出请求
function confia(actionurl){
jQuery.ajax({
url: actionurl,//提交访问的URL
type: 'POST',//提交的方法
dataType: 'html',//返回的内容的类型,由于PHP文件是直接echo的,那么这里就是text
timeout: 1000,//超时时间
error: function(){ //如果出错,执行函数
},
success: function(data)
{
resu(data,"1");
}
});
}//ajax返回数据
function resu(data,status)
{
alert(data);//在这里怎么获取不到ajax返回的数据?????
}php后台代码:
function getCode_group(){
$db = Db::getInstance();
$cond=$_REQUEST['cond'];
$str="select * from info_codedtl where code_no='".$cond."' AND code_type='AST18'";
$listr=$db->query($str);
echo json_encode($listr);
}
echo json_encode($listr);