I have a problem with the ajax script when I deploy applications on my Linux Server (hosting).

When I deploy on my Linux Server, the script "error: function" does not work and only calls "success: function (response)". As when an error occurs, the method "alert("Data Tidak Ditemukan");" and selector "$ (".validasi").show();" it doesn't work, even though in localhost my application is fine, when I deploy on hosting the problem occurs. Please help me find the problem..

function search() {
    type: "POST",
    url: "<?php echo base_url('pengajuan_ktp/ajax_search'); ?>",
    data: {
      nik: $("#nik").val()
    dataType: "json",
    beforeSend: function(e) {
      if (e && e.overrideMimeType) {
    success: function(response) {
      if (response.status == "success") {
      } else {
        alert("Data Tidak Ditemukan");
    error: function(jqXHR, ajaxOptions, thrownError) { //this doesn't work on my Linux Server
      alert("Data Tidak Ditemukan");

0 Answers