Ajax、js、 xml 、jsp菜单 测试二级联动查询

本文介绍了一个使用 Ajax 实现的菜单系统,包括省份和城市的选择联动功能。
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Ajax菜单  测试二级联动查询</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <script type="text/javascript">
        var xmlHttp;
        function createXMLRequest(){
            if(window.ActiveXObject){
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }else if(window.XMLHttpRequest){
                xmlHttp = new XMLHttpRequest();
            }else{
                alert("你的浏览器不支持Ajax!");
            }
        }
        
        function getCities(){
            createXMLRequest();
            var province = document.getElementById("provincesID").value;
            xmlHttp.open("post", "test/getCities.jsp?province="+province, true);
            xmlHttp.onreadystatechange = returnCities;
            xmlHttp.send(null);
        }
        
        function returnCities(){
            var cs = document.getElementById("citiesID");
            if(xmlHttp.readyState == 4){
                if(xmlHttp.status == 200){
                
                    var returnXML = xmlHttp.responseXML;
                    var city = returnXML.getElementsByTagName("city");
                    while(cs.childNodes.length>2){
                        cs.removeChild(cs.childNodes[cs.childNodes.length-1]);
                    }
                    for(var i=0;i<city.length; i++){
                        var option = document.createElement("option");
                        option.innerHTML = city[i].firstChild.data;
                        cs.appendChild(option);
                    }
                }
                
            }
        }
    </script>

  </head>
 
  <body>
    <div>
        <h3>级联菜单</h3>
        选择省份:
        <form action="to.jsp" method="post">
            <select name="provinces" id="provincesID" onchange="getCities()">
                <option value="">--请选择省份--</option>
                <option value="zj">浙江</option>
                <option value="gd">广东</option>
            </select>
            选择城市:
            <select name="cities" id="citiesID">
                <option value="">请选择城市</option>
            </select>
            
            <input type="submit" value="提交">
        </form>
    </div>
  </body>
</html>


==============================

<%
String province = request.getParameter("province");
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
response.setContentType("text/xml;charset=utf-8");
if(province.equals("zj")){
out.println("<?xml version='1.0' encoding='utf-8'?>");
out.println("<cities>");
out.println("<city>杭州</city>");
out.println("</cities>");
}
if(province.equals("gd")){
out.println("<?xml version='1.0' encoding='utf-8'?>");
out.println("<cities>");
out.println("<city>guangzhou</city>");
out.println("</cities>");
}%>

【轴承故障诊断】加权多尺度字典学习模型(WMSDL)及其在轴承故障诊断上的应用(Matlab代码实现)内容概要:本文介绍了加权多尺度字典学习模型(WMSDL)在轴承故障诊断中的应用,并提供了基于Matlab的代码实现。该模型结合多尺度分析与字典学习技术,能够有效提取轴承振动信号中的故障特征,提升故障识别精度。文档重点阐述了WMSDL模型的理论基础、算法流程及其在实际故障诊断中的实施步骤,展示了其相较于传统方法在特征表达能力和诊断准确性方面的优势。同时,文中还提及该资源属于一个涵盖多个科研方向的技术合集,包括智能优化算法、机器学习、信号处理、电力系统等多个领域的Matlab仿真案例。; 适合人群:具备一定信号处理和机器学习基础,从事机械故障诊断、工业自动化、智能制造等相关领域的研究生、科研人员及工程技术人员。; 使用场景及目标:①学习并掌握加权多尺度字典学习模型的基本原理与实现方法;②将其应用于旋转机械的轴承故障特征提取与智能诊断;③结合实际工程数据复现算法,提升故障诊断系统的准确性和鲁棒性。; 阅读建议:建议读者结合提供的Matlab代码进行实践操作,重点关注字典学习的训练过程与多尺度分解的实现细节,同时可参考文中提到的其他相关技术(如VMD、CNN、BILSTM等)进行对比实验与算法优化。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值