使用ajax发布带有URL的ID

时间:2019-01-16 05:12:19

标签: ajax codeigniter-3

im write ajax code in post url and my userid bt not respond that code

<script>

function InviteLink( id, url ){
    console.log(id);
    $.ajax({
      url: https://abc.hrm.com/auth/login
      data: { 'id' : id },      
      success: function(data) {
      }
      });
} 

</script>
<button  onclick="InviteLink('<?php echo $employees->fldUserID; ?>','<?php echo base_url($employee_url); ?>');" style="background-color:#00C292; color:white;  font-weight: bold; margin:5px 0px;" title="Invite New Employee" data-toggle="modal" data-target="#invitelink" type="button" class="btn btn-teal btn-circle"><i class="notika-icon notika-mail"></i></button>

**按钮中的前UI我编写了onclick函数并获取ID和url ....,但我的URL中没有帖子,请帮助我解决问题**

1 个答案:

答案 0 :(得分:0)

您必须在像下面这样的ajax中添加方法类型=“ POST”

system.time(
   for(i in 1:12){
     for (j in 1:nrow(df_a)) {
       if(df_b$month[i]==df_a$month[j]){
         df_a$daily[j] <- df_a$daily[j]+(df_b$obs[i]-df_b$model[i])
       }
     }
   }
 )
#   user  system elapsed 
#  9.661   2.741  12.306