首页 >

基于asp+ajax和数据库驱动的二级联动菜单

php教程|php手册基于asp+ajax和数据库驱动的二级联动菜单
asp,ajax,二级联动菜单
php教程-php手册
html5麻将源码,vscode概念商品,archlinux和ubuntu,tomcat 部署应用,sqlite 关联查询,网页设计尺寸最新,dede 修改数据库,云服务器品牌,kindeditor 插件开发,目前主流前端框架软件,饭爬虫,php 时间计算,seo优化人员,springboot翻墙,css3动画 a标签,简洁的网站地图模板,易语言网页抓包工具,免费 后台模板,主机包后台密码,图书馆注册页面JSP,人事档案管理系统web,excel 导入程序代码lzw
基于asp+ajax和数据库驱动的二级联动菜单,需要的朋友可以参考下。
post网页源码,vscode动态调试插件,ubuntu语音服务,tomcat无法重新登录,会计 爬虫,php asp 对比,网络推广seo优化引流,毕设源程序网站,移动端商城模板htmllzw
聚合影视源码安装教程,装了ubuntu怎么进入,java如何编写爬虫,php 缓冲文件,seo渗透专员lzw

index.asp 页面代码
代码如下:

<%
set cmd = conn.execute(“select bigclassid,bigclassname from bigclass”)
tempid=cmd(“bigclassid”)
%>

<%
if not cmd.eof then
do while not cmd.eof
bigclassid= cmd(“bigclassid”)
bigclassname = cmd(“bigclassname”)
%>
<option value="”>
<%
cmd.movenext
loop
end if
cmd.close
set cmd = nothing
%>

<%
set cxd = conn.execute(“select * from smallclass where bigclassid=” & tempid)
if not cxd.eof then
do while not cxd.eof
smallclassid= cxd(“smallclassid”)
smallclassname = cxd(“smallclassname”)%>
<option value="”>
<%
cxd.movenext
loop
cxd.close
set cxd = nothing
else
html = “暂无小类”
response.write html
end if
%>

ajax.js 代码
代码如下:
// JavaScript Document
function createxmlhttp()
{
xmlhttpobj = false;
try{
xmlhttpobj = new XMLHttpRequest;
}catch(e){
try{
xmlhttpobj=new ActiveXObject(“MSXML2.XMLHTTP”);
}catch(e2){
try{
xmlhttpobj=new ActiveXObject(“Microsoft.XMLHTTP”);
}catch(e3){
xmlhttpobj = false;
}
}
}
return xmlhttpobj;
}

function getsubcategory(bigclassid){
if(bigclassid==0){
document.getElementById(“subclass”).innerHTML=”选择二级分类”;
return;
};
var xmlhttpobj = createxmlhttp();
if(xmlhttpobj){//如果创建对象xmlhttpobj成功
xmlhttpobj.onreadystatechange=handle;
xmlhttpobj.open(‘get’,”getsubcategory.asp?bigclassid=”+bigclassid+”&number=”+Math.random(),true);//get方法 加个随机数。

xmlhttpobj.send(null);
}
}

function handle(){//客户端监控函数
//if(xmlhttpobj.readystate==4){//服务器处理请求完成
if(xmlhttpobj.status==200){
//alert(‘ok’);
var html = xmlhttpobj.responseText;//获得返回值
document.getElementById(“subclass”).innerHTML=html;
}else{
document.getElementById(“subclass”).innerHTML=”对不起,您请求的页面有问题…”;
}
/


基于asp+ajax和数据库驱动的二级联动菜单
  • javascript读取Xml文件做一个二级联动菜单示例【javascript】
  • javascript读取Xml文件做一个二级联动菜单示例【javascript】 | javascript读取Xml文件做一个二级联动菜单示例【javascript】 ...

    基于asp+ajax和数据库驱动的二级联动菜单
  • php+mysql实现的二级联动菜单效果详解【PHP】
  • php+mysql实现的二级联动菜单效果详解【PHP】 | php+mysql实现的二级联动菜单效果详解【PHP】 ...

    基于asp+ajax和数据库驱动的二级联动菜单
  • php怎么实现二级联动菜单
  • php怎么实现二级联动菜单 | php怎么实现二级联动菜单 ...