首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

jquery 开发中惯用的代码

2012-10-07 
jquery 开发中常用的代码下面的代码都从自己手头中的项目中整理。比较乱,没有时间整理啊。ajax:$.ajax({type

jquery 开发中常用的代码
下面的代码都从自己手头中的项目中整理。比较乱,没有时间整理啊。
ajax:

$.ajax({    type:"post",    url:"complexReport.do?method=getHySelectHtml",    async: false,    data:{jclx:encodeURIComponent(lx)},    success:function(data){        //alert(data)        $("#sshytd").html(data);    } });

事件绑定,jquery支持当前给页面中不存在的dom元素添加事件。比如:该dom元素是ajax加载的。
$("#sumRadio").live("click",function(){     window.location.href="sumReport.do?method=showSumReportPage&path=sumReportPage&jclx=dbswr";        });

jquery的选择器示例和选取元素属性值的示例:
$("select[name=jclxselect] option:selected").text()) //name 为checkbox name function CheckAll(e,name){   var checked = $(e).attr('checked');      $(e).parents('table').find('input[type=checkbox][name='+name+']').each(function(){           if(!$(this).attr("disabled")){            $(this).attr("checked",checked);         }    }); }//下面的代码是给一个表格的某几列添加click时间,并且对

jquery的工具函数:
$.trim(content)

热点排行