jquery函数无法处理click事件

时间:2016-11-28 11:50:18

标签: javascript jquery

这是我的jquery函数,它不起作用,

$(document).on('click',"#btn_submit",function(){
        $('.task_members_'+$(this).parent().parent().find('.j').val()).val(selectedImgsArr);
      var select_status = ("#label_task").val();
      var j = $(".j").attr('value');
      var url = "<?php echo $this->Url->build(array('controller' => 'dashboards','action'=>'addarraysessionproject'))?>";

         $.ajax({
          type: "POST",
          url: url,
          async : false,
          data: {
                  array_user : selectedImgsArr,
                  array_status : custom_array,
                  select_status : select_status,
                  'j': j
                },
          success:function(data){
          }
      });
        $('.close').click();
    });

请让我知道我哪里出错了。

1 个答案:

答案 0 :(得分:1)

试试这个,我认为它在行var select_status上的错误

$(document).on('click',"#btn_submit",function(){
        $('.task_members_'+$(this).parent().parent().find('.j').val()).val(selectedImgsArr);
      var select_status = $("#label_task").val();
      var j = $(".j").attr('value');
      var url = "<?php echo $this->Url->build(array('controller' => 'dashboards','action'=>'addarraysessionproject'))?>";

         $.ajax({
          type: "POST",
          url: url,
          async : false,
          data: {
                  array_user : selectedImgsArr,
                  array_status : custom_array,
                  select_status : select_status,
                  'j': j
                },
          success:function(data){
          }
      });
        $('.close').click();
    });