美文网首页
【总结】JQuery方法

【总结】JQuery方法

作者: giraffecode9668 | 来源:发表于2019-05-13 16:02 被阅读0次

2019-05-13

发送ajax请求:

 $.ajax({
                  url:"${APP_PATH}/emp/"+del_idstr,
                    type:"DELETE",
                    success:function(result) {
                        alert(result.msg);
                        to_page(currentPage);
                    }
                });

each方法

  $.each( $(".check_item:checked"),function() {
                empNames += $(this).parents("tr").find("td:eq(2)").text() + ",";
                del_idstr += $(this).parents("tr").find("td:eq(1)").text() + "-";
            });

给使用js语句创建的元素绑定方法

$(document).on("click",".check_item",function() {
            var flag = $(".check_item:checked").length == $(".check_item").length;
            $("#check_all").prop("checked",flag);
        });

绑定事件

 $("#check_all").click(function(){
            $(".check_item").prop("checked",$(this).prop("checked"))
        });

相关文章

网友评论

      本文标题:【总结】JQuery方法

      本文链接:https://www.haomeiwen.com/subject/zicraqtx.html