skip to Main Content

I have a problem to get id. How can I get the dynamic ID ?

ajax ": {
"url": base_url + "certificate/get_certificate/" + 2 - > this I want to be a dynamic,
  "type": "POST"
},

2

Answers


  1. var id = $('#id').val();
    $.ajax({
        url: '<?php echo base_url();?>certificate/get_certificate',
        method: 'POST',
        data: { id: id },
    });
    
    Login or Signup to reply.
  2. var id=$('#id').val(); 
    ajax": {
            "url": '<?php echo base_url(); ?>certificate/get_certificate?id='+id ,
            "type": "POST"
           },
    

    try any code both are same

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search