zoukankan      html  css  js  c++  java
  • 页面分页动态加载采用冒泡事件动态绑定点击事件

     页面的分页,下页的点击事件要采用冒泡机制。 

    //利用冒泡事件动态加载
    $(document).on("click",".edNesAcu",function(){

    // $(".edNesAcu").on('click',function(){
    //var userBid = $(this).$(".bidInfo").this.parents('tr').find('td').eq('0').text();
    var userBid = $(this).parents('tr').find('td').eq('2').text();
    alert(userBid);
    $('.content_right').remove();
    $(".right-product").load(''+url+'/user/compileAccount/'+userBid,function () {

    $("#asdf").on('click',function(){
    console.log("coming2");
    var formData = JSON.stringify($("#formData").serializeObject());
    //var userBid = $(".userBid").val();
    console.log("userBid: "+userBid);
    // console.log(formData);
    //账户状态
    var status=$('input[name="status"]:checked').val();
    // alert("updateStatus: "+status);
    //客户组权限
    var privilege ="";
    console.log( $('#privilege').is(':checked'));
    if ($('#privilege').is(':checked')) {
    privilege = "1";
    } else {
    privilege = "0";

    }
    debugger;
    //子账号权限
    var businessUnitPrivi = "";
    console.log($('#businessUnitPrivi').is(':checked'));
    if ($('#businessUnitPrivi').is(':checked')) {
    businessUnitPrivi = "1";
    } else {
    businessUnitPrivi = "0";

    }
    //服务菜单
    var serviceMenu = [];

    //商品类目
    var serviceType=[];

    $('input[name="serviceType"]:checked').each(function(){
    serviceType.push($(this).val());
    });
    console.log("serviceType:"+serviceType);

    //账号角色
    var roleListBox=[];
    $('input[name="roleListBox"]:checked').each(function(){
    roleListBox.push($(this).val());
    });
    console.log("roleListBox:"+roleListBox);
    // alert("updateUserBid:"+userBid);
    debugger;
    $.ajax({
    url:url+"/user/update",
    type:"post",
    dataType:"json",
    data:{
    "formData":formData,
    "userBid":userBid,
    "status":status,
    "privilege":privilege,
    "businessUnitPrivi":businessUnitPrivi,
    "serviceMenu":serviceMenu,
    "serviceType":serviceType[0],
    "roleListBox":roleListBox
    },
    success:function(res){
    console.log(res);
    alert("update success");
    startPag();
    }

    });
    })
    });
    });

  • 相关阅读:
    Android Lint简介
    免费HTTP数据抓包Fiddler2[4.6.1.2]以及显示中文包内容的方法
    IE6、7下bug
    图表插件
    学习:使用svg
    jQuery Transit
    jQuery基础学习笔记(1)
    HTTP协议详解学习
    html5学习笔记
    html释疑
  • 原文地址:https://www.cnblogs.com/21heshang/p/7096499.html
Copyright © 2011-2022 走看看