• jquery foreach


    Js代码
    1. <form id="input_iForm" action="${pageContext.request.contextPath}/transfer/input_salary.shtml">  
    2.    
    3. <input type="text" class="input_w150" vili="true" onkeyup="formatBankNo(this)"/>  
    4.    
    5.       <input type="text" class="input_w150" vili="true" onkeyup="formatBankNo(this)"/>  
    6.    
    7.       <input type="text" class="input_w150" vili="true" onkeyup="formatBankNo(this)"/>  
    8.    
    9. </form>  
    10.    
    11.    
    12.    
    13.    
    14.    
    15. $("input").each(function(index){ //取得整个页面的input值  
    16.    
    17. $("input:text").each(function(index){  
    18.   alert(index);//循环的下标值,从0开始  
    19.   alert(this.value);  alert($(this).attr("type"));  //自带属性可以用this(Dom)直接取值  
    20.   alert($(this).attr("vili"));                               //自定义属性需要用attr(Jquery)取值  
    21.   //if($(this).attr("vili")=="true"&&){  
    22.       
    23.   //}  
    24.  });   
    Js代码
    1. $.ajax({  
    2.       url: '<%=basePath%>schedule/getMonthRecordLs.action',  
    3.       dataType: 'json',  
    4.       success: function(data) {  
    5.           var events = [];  
    6.           $(data).each(function(i,val) {  
    7.               events.push({  
    8.                 id: val.sc_id,  
    9.                   title: val.sc_planemp,  
    10.                   start: new Date(val.sc_date),  
    11.                   color: val.sc_classes=='1'?'':'#993300'  
    12.               });  
    13.           });  
    14.           callback(events);  
    15.       }  
    16.   }); 
  • 相关阅读:
    XML解析
    用进度条显示从网络上下载文件进度
    android—获取网络数据
    android中sharedPreferences的用法
    实现listview中checkbox的多选与记录
    利用Bundle在activity之间传递对象
    Activity使用Serializable传递对象实例
    工作框架各种使用整理 -- 页面参数传递
    ubuntu中安装VMWare tools
    工作框架各种使用整理 -- 自己处理分页且输入条件中有过滤条件
  • 原文地址:https://www.cnblogs.com/keanuyaoo/p/3265375.html
Copyright © 2020-2023  润新知