if(!(window.jQuery)) { var s = document.createElement('script'); s.setAttribute('src', '//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js'); s.setAttribute('type', 'text/javascript'); document.getElementsByTagName('head')[0].appendChild(s); } if(window.addEventListener){ window.addEventListener("load",jhcChaLoad,false); } else{ window.attachEvent("onload",jhcChaLoad); } function jhcChaLoad(){ //加载数据 $.ajax({ type:"GET", url:"/e/extend/jhcKoudian/jilu.php", data:{act:88}, dataType:"html", success: function(ret){ $("#jhcli").html(ret); }, error:function(){ } }); $("#All").on("click",function(){ $("#jhcli").find("input").prop("checked",1); }); $("#uncheck").on("click",function(){ $("#jhcli").find("input").prop("checked",0); }); $("#othercheck").on("click",function(){ $("#jhcli").find("input").each(function(i){ $(this).prop("checked",!$(this).prop("checked")); }); }); $("#clearall").on("click",function(){ $.ajax({ type:"GET", url:"/e/extend/jhcKoudian/jilu.php", data:{act:3}, dataType:"html", success: function(ret){ window.location.reload(); }, error:function(){ } }); }); $("#clearchecked").on("click",function(){ var who=''; $.each($('input:checkbox:checked'),function(){ who=who+$(this).val()+','; }); $.ajax({ type:"GET", url:"/e/extend/jhcKoudian/jilu.php", data:{act:2,keys:who}, dataType:"html", success: function(ret){ //alert(ret); window.location.reload(); }, error:function(){ } }); }); }