In my ajax form request is not working properly

时间:2018-12-03 12:56:29

标签: php jquery ajax codeigniter

I want to give some alert message in my page but it working

This is my view code:

$.ajax({
    url :"<?php echo base_url();? 
     >booking/dispatch_challan/DispatchChallanController/createDispatchChallan",
    type:"POST",
    dataType: "json",
    data:$("#dispatch_challan_form").serialize(),
    data:$("#dispatch_challan_form").serialize()+'&disp_ch_ids='+allVals,
    success: function(data)
    {
     if(data.create_dispatch_challan.form_status=='false')
      {
      alertify.error('you may occured some server side errors');
      }else if(data.create_dispatch_challan.form_status=='true')
      {
    alertify.success(data.create_dispatch_challan.form_message);
    if (confirm())
     {
      alert("print");
      }else{
      alert("Do not print");
    }
    }
    }
    });

please give me same solution in this.

1 个答案:

答案 0 :(得分:0)

Its not OK to have a new line here

url :"<?php echo base_url();? 
>booking/dispatch_challan/DispatchChallanController/createDispatchChallan",

Try this code: pastebin