zoukankan      html  css  js  c++  java
  • JQuery中如何使用事件来出发Ajax

    $(document).ready(function(){
            
            $("input[name='customer_name']").keydown(function(e){
            if(e.keyCode==13){
                
                search();
            }
            });
            $("input[name='customer_role']").keydown(function(e){
            if(e.keyCode==13){
                
                search();
            }
            });
            });
       
        function search(){
            var url ='<%=searchCustomerURL %>';
            var customerName = $("input[name='customer_name']").val();
            var customerRole = $("input[name='customer_role']").val();
            $.get(url, {customer_name:customerName,customer_role:customerRole}, function(response) {
                if (response.length > 0) {
                    //$('#<portlet:namespace/>reportTips').html(treeNode.name);
                    $('#<portlet:namespace/>reportListBox').empty().html(response);
                }
            });
            
            
        }

  • 相关阅读:
    redis概要学习
    http协议格式详解
    浅谈mysql
    linux常用命令
    Linux 程序管理
    认识与分析日志文件
    认识与学习bash
    例行任务管理
    软件安装的三大方法
    关于一些感慨
  • 原文地址:https://www.cnblogs.com/airycode/p/4916629.html
Copyright © 2011-2022 走看看