function queryCity(citycode){
createXMLHttpRequest();
requestType="city";
var url="/esoxue.php/Crm/area/provincecode/"+citycode+"/"+Math.random();
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=handleStateChange;
xmlHttp.send(null);
}
function queryArea(citycode){
createXMLHttpRequest();
requestType="area";
var url="/esoxue.php/Crm/area/citycode/"+citycode+"/"+Math.random();
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=handleStateChange;
xmlHttp.send(null);
}
function showcity(){
document.getElementById("city").innerHTML=xmlHttp.responseText;//捕获ID显示返回的数据
}
function showarea(){
document.getElementById("area").innerHTML=xmlHttp.responseText;//捕获ID显示返回的数据
}
html代码:
执行代码:
public function area()
{
$area =M('Area');
$provincecode=$_GET['provincecode'];//接收省键值
$citycode=$_GET['citycode'];//接收城市键值
if($provincecode !=""){
$citys=$area->where("parent_id='$provincecode'")->select();
echo "