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);
                }
            });
            
            
        }

  • 相关阅读:
    安利博客
    python 的高阶算法之堆排序
    functools模块用途
    类型注解
    高阶函数和装饰器
    生成器

    递归函数
    匿名函数
    函数 的 返回值作用域
  • 原文地址:https://www.cnblogs.com/airycode/p/4916629.html
Copyright © 2011-2022 走看看