这是我在网上查找到的php实现三级级联下拉框的资料,共享个大家,大家一起进步,具体内容如下
index.php:
Ajax联动菜单
aa.js
XMLHttpRequest对象的status属性值为200 , html文件在本地运行,则xmlHttp.status的返回值为0,故应该加上xmlHttp.status==0
if(xmlHttp2.status==200 || xmlHttp2.status==0) //调用文档对象模型DOM的getElementById()方法查找html文件中的标签txtHint ,
//innerHTML为IE浏览器中的属性,可以用来更改标签间文本的内容 ,
//xmlHttp.responseText , 通过XMLHttpRequest的responseText属性来获取数据 responseText,结果为字符串;responseXML,结果为XML形式
// document.getElementByIdx_x_xx_x_xx("txtHint").innerHTML=xmlHttp.responseText
BuildSel(xmlHttp2.responseText,document.getElementsByTagName_r("*").sel3) }
}
//函数GetXmlHttpObject() - 创建XMLHttpRequest对象,即创建一个异步调用对象
function GetXmlHttpObject() var xmlHttp=null;
try // Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest(); catch (e) //Internet Explorer
try xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); catch (e) xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
return xmlHttp; -->
get2.php
以上就是php实现三级级联下拉框的相关代码,希望对大家学习php程序设计有所帮助。



